Route#controllerFor()

controllerFor (name) Ember.Controllerpublic

Defined in packages/ember-routing/lib/system/route.js:1672

Returns the controller for a particular route or name.

The controller instance must already have been created, either through entering the associated route or using generateController.

App.PostRoute = Ember.Route.extend({
  setupController: function(controller, post) {
    this._super(controller, post);
    this.controllerFor('posts').set('currentPost', post);
  }
});

Parameters:

name String
the name of the route or controller

Returns:

Ember.Controller
doc_EmberJs
2016-11-30 16:53:05
Comments
Leave a Comment

Please login to continue.