Md Nazmul Hossain
Md Nazmul Hossain

Reputation: 2933

How to show a loader untill on Js & CSS files loading using angularJs

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

Upvotes: 0

Views: 85

Answers (3)

Md Nazmul Hossain
Md Nazmul Hossain

Reputation: 2933

I have found a solution & it works for me.

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

Upvotes: 0

Niklesh Raut
Niklesh Raut

Reputation: 34914

Display you loader image initially and hide here

$scope.$on('$viewContentLoaded', function() {
    //Code to hide loader
});

Upvotes: 1

gcoreb
gcoreb

Reputation: 181

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

Upvotes: 0

Related Questions