Route#controller

controllerEmber.Controllerpublic

Defined in packages/ember-routing/lib/system/route.js:729
Available since 1.6.0

The controller associated with this route.

Example

App.FormRoute = Ember.Route.extend({
  actions: {
    willTransition: function(transition) {
      if (this.controller.get('userHasEnteredData') &&
          !confirm('Are you sure you want to abandon progress?')) {
        transition.abort();
      } else {
        // Bubble the `willTransition` action so that
        // parent routes can decide whether or not to abort.
        return true;
      }
    }
  }
});
doc_EmberJs
2016-11-30 16:53:05
Comments
Leave a Comment

Please login to continue.