Route#resetController()

resetController (controller, isExiting, transition) public

Defined in packages/ember-routing/lib/system/route.js:444
Available since 1.7.0

A hook you can use to reset controller values either when the model changes or the route is exiting.

App.ArticlesRoute = Ember.Route.extend({
  // ...

  resetController: function(controller, isExiting, transition) {
    if (isExiting) {
      controller.set('page', 1);
    }
  }
});

Parameters:

controller Controller
instance
isExiting Boolean
transition Object
doc_EmberJs
2016-11-30 16:53:12
Comments
Leave a Comment

Please login to continue.