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
import Ember from 'ember';
import nprogress from 'nprogress';
export default Ember.Route.extend({
model(params){
nprogress.start();
let promise = this.store.findRecord('post', params.id);
return promise.then(function(post){
nprogress.done();
return post;
});
}
});
Showing 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.