如何在整个项目中添加一个通用加载程序或进度条 [英] how can i add one common loader or progress bar to entire project
本文介绍了如何在整个项目中添加一个通用加载程序或进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在angularjs中做我的项目 如何使用css为整个项目添加一个公共加载器或进度条 ,而不是为每个调用show / hide块函数控制器的div类。
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.
推荐答案
你必须编写一个拦截器才能做到这一点。要了解拦截器,请参阅: https://docs.angularjs.org/api/ng/service/ $ http
You have to write an interceptor to do that. To learn about interceptor refer: https://docs.angularjs.org/api/ng/service/$http
但是有人已经完成了所有的工作,所以为什么要重新发明轮子!
http://chieffancypants.github.io/angular-loading-bar/
But someone has already done all the works, so why re-invent the wheel! http://chieffancypants.github.io/angular-loading-bar/
这篇关于如何在整个项目中添加一个通用加载程序或进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文