我一直在环顾四周,而且自己没有写一个基本的,我找不到一个已经存在的Ember库,它在页面顶部显示一个小的加载行,当所有的http请求都已完成时页面转换(无论是图像加载,JSON被提取等).
对于Angular有这个:http://chieffancypants.github.io/angular-loading-bar/,但想知道Ember是否已经有任何选择.
干杯.
编辑:我发现这篇文章也是关于一个jQuery插件,我想这可以改编:http://tutorialzine.com/2013/09/quick-tip-progress-bar/.仍然热衷于听到有人知道已经集成到Ember请求生命周期中的任何事情.
小智 6
你可以使用梦幻般的javascript组件NProgress(http://ricostacruz.com/nprogress)
然后你可以Application.ready使用像这样的jQuery 在事件中初始化它
window.App.ready = function () {
$(document).ajaxStart(function () {
NProgress.start();
});
$(document).ajaxStop(function () {
NProgress.done();
});
};
Run Code Online (Sandbox Code Playgroud)