This ember-cli addon simplifies integration of NProgress plugin with ember-cli apps.
ember install ember-cli-nprogress
Note: Version 2.9.0
or higher of the Ember CLI is required
NProgress
while a model loadsimport Ember from 'ember';
import progress from 'ember-cli-nprogress';
export default Ember.Route.extend({
model(params){
progress.start();
let promise = this.store.findRecord('post', params.id);
return promise.then(function(post){
progress.done();
return post;
});
}
});
NProgress
during all loading substates// app/routes/application.js
import Ember from 'ember';
import nprogress from 'nprogress'
export default Ember.Route.extend({
actions: {
loading(transition) {
nprogress.start();
transition.finally(() => {
nprogress.done();
});
return true;
}
}
});
See rstacruz/nprogress for details.