In my case, I realized that my problems were collecting while waiting for ajax requests. Ng-cloak probably works for static content, but if the template depends on ajax data, then it is displayed this way before receiving the ajax response.
To avoid this, I define a directive:
Angu
mymodule .directive("ajaxCloak", ['$interval', '$http', function ($interval, $http) { return { restrict: 'A', link: function (scope, element, attrs) { let stop = $interval(() => { if ($http.pendingRequests.length === 0) { $interval.cancel(stop); attrs.$set("ajaxCloak", undefined); element.removeClass("ajax-cloak"); } }, 100); } }; }]);
With a bit of CSS:
[ajax-cloak], [data-ajax-cloak], [x-ajax-cloak], .ajax-cloak { display: none !important; }
Then in your main HTML file:
<div ui-view data-ajax-cloak></div>
Note: this is not as complicated as ng-cloak, since it is a global cesspool, it hides everything until all requests are complete.
Rolintocour Jul 25 '16 at 9:48 2016-07-25 09:48
source share