Skip to content

Commit

Permalink
Merge pull request #13343 from duggiefresh/13341-update-route-loading…
Browse files Browse the repository at this point in the history
…-example

[DOC beta] Update Route#loading example
  • Loading branch information
rwjblue committed Apr 16, 2016
2 parents c3a1dc5 + c4b20e3 commit fe04b2f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/ember-routing/lib/system/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,16 +612,12 @@ var Route = EmberObject.extend(ActionHandler, Evented, {
App.ApplicationRoute = Ember.Route.extend({
actions: {
loading: function(transition, route) {
var view = Ember.View.create({
classNames: ['app-loading']
})
.append();
let controller = this.controllerFor('foo');
controller.set('currentlyLoading', true);
this.router.one('didTransition', function() {
view.destroy();
transition.finally(function() {
controller.set('currentlyLoading', false);
});
return true; // Bubble the loading event
}
}
});
Expand Down

0 comments on commit fe04b2f

Please sign in to comment.