Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当您更改视频时,YouTube 有这个疯狂的酷功能,有一个指示页面加载的栏。使用AngularJS,我怎样才能有同样的效果?
AngularJS
这是一个好的开始:https ://github.com/chieffancypants/angular-loading-bar
它有一个拦截器,可以在触发 XHR 时显示条形图,您可以对其进行更改,以便在 $routeChangeStart 上显示条形图并在 $routeChangeSuccess 上隐藏它。
PACE对你有好处,它比你想要的要多;
http://github.hubspot.com/pace/docs/welcome/
或者你可以使用Loadingbar.js;
http://www.onextrapixel.com/2013/09/02/loadingbar-js-adding-a-youtube-like-loading-bar-to-your-website/