Skip to content

thedyrt/ember-cli-nprogress

 
 

Repository files navigation

ember-cli-nprogress

This ember-cli addon simplifies integration of NProgress plugin with ember-cli apps.

Installation

ember install ember-cli-nprogress

Note: Version 2.9.0 or higher of the Ember CLI is required

Usage Examples

Showing NProgress while a model loads

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;
    }
  }
});

API

See rstacruz/nprogress for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 85.4%
  • HTML 14.6%