0

I want to show a loader untill all css, js files are loaded. I want to do this using angularJs. Can anyone give me solutions for this problem ? How can detect all js, css files loaded using angularjs ?

Thanks in advance

1
  • Do you want a loader which should work for every $http call Commented Jul 19, 2016 at 6:11

3 Answers 3

1

Display you loader image initially and hide here

$scope.$on('$viewContentLoaded', function() {
    //Code to hide loader
});
Sign up to request clarification or add additional context in comments.

1 Comment

This code will work on controller, so we need to load the controller. But I want this on configuration. So I am trying with - $rootScope.$on('$viewContentLoaded', function() { console.log("ALl contents loaded") });
0

I would recommend using this plugin. Angular-loading bar will show a loading bar until everythnig loads.

Comments

0

I have found a solution & it works for me.

angular.module().run(function(){
   angular.element(document).ready(function(){
       /* Loaders code will be here */
   })
})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.