Issue
Is there any equivalent of window.onload event in Angular?
I want to fade out and remove my preloader but only after all resources like images are loaded. Since $viewConteneLoaded indicates only html insertion into view (i am using ngRotue) listening to it is not sufficient.
I would like to capture window.onload event, but don't know how to do it properly and what is the best-practice for doing it in Angular, so that digest would fire.
Solution
Try to use $window.onload
event.
Example:
angular.element($window).bind('load', function() {
//put you code
});
Answered By - kamprasad
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.