diff --git a/app/mixins/loading-slider.js b/app/mixins/loading-slider.js index 6918359..66c019f 100644 --- a/app/mixins/loading-slider.js +++ b/app/mixins/loading-slider.js @@ -1,6 +1,7 @@ import { inject as service } from '@ember/service'; import Mixin from '@ember/object/mixin'; import { isPresent } from '@ember/utils'; +import { getOwner } from '@ember/application'; export default Mixin.create({ loadingSlider: service(), @@ -9,8 +10,11 @@ export default Mixin.create({ loading() { let loadingSliderService = this.get('loadingSlider'); loadingSliderService.startLoading(); - if (isPresent(this._router)) { - this._router.one('didTransition', function() { + + let routerService = getOwner(this).lookup('service:router'); + let router = routerService ? routerService._router : this._router; + if (isPresent(router)) { + router.one('didTransition', function() { loadingSliderService.endLoading(); }); }