all files / app/ router.js

100% Statements 10/10
100% Branches 4/4
100% Functions 3/3
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45                                                                         
import Ember from 'ember'
import config from './config/environment'
import nprogress from 'ember-cli-nprogress'
 
const Router = Ember.Router.extend({
 
  // ----- Overridden properties -----
  location: config.locationType,
  rootURL:  config.rootURL,
 
 
 
  // ----- Custom properties -----
  initialLoadingComplete: false,
 
 
 
  // ----- Overridden methods -----
  willTransition () {
    if (this.get('initialLoadingComplete')) nprogress.start()
 
    this._super(...arguments)
  },
 
  didTransition () {
    this._super(...arguments)
 
    if (this.get('initialLoadingComplete')) nprogress.done()
    else this.set('initialLoadingComplete', true)
  },
})
 
 
 
 
Router.map(function () {
  this.route('city', {path: ':cityId'})
})
 
 
 
 
export default Router