I'm doing my project in angularjs how can i add one common loader or progress bar to entire project with css rather than calling show/hide block functions for every controller's div class.
相关问题
- Angular RxJS mergeMap types
- angularJS: ui-router equivalent to $location.searc
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- Separate AngularJS Controllers Into Separate Files
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Passing variable through URL with angular js
- Watch entire object (deep watch) with AngularJS
- Angular ng-if change span text
- Is a unicode user agent legal inside an HTTP heade
- Can ng-show directive be used with a delay
- AngularJS $routeParams vs $stateParams
- Multiple parameters in AngularJS $resource GET
You can use angular-loading-bar http://chieffancypants.github.io/angular-loading-bar/#
This is the best progress bar working in background.
Here is the documentation http://angular-js.in/loading-bar/
Also the demo is available there.
To change color of loading bar use css
Until you get the response you can put a waiting dialog.. after getting the response you can hide the dialog.. Here is a link of simple dialog using jquery waitingDialog
And this dialog can be best used with angular and you can alter it according to your requirement so good luck..
Do it something like this
Then use event bound to
$rootScope
anywhere (preferable to use in directive or run block of app.js):You can read more about it here codingsmackdown
You have to write an interceptor to do that. To learn about interceptor refer: https://docs.angularjs.org/api/ng/service/$http
But someone has already done all the works, so why re-invent the wheel! http://chieffancypants.github.io/angular-loading-bar/