Accessing Ember-cli Nested Controllers
This is my directory structure: controllers/ ---- restaurant/ ----items.js ---- index.js ---- restaurant.js And my router declaration: this.route('restaurants',{ path: '/resta
Solution 1:
As of Ember-CLI v0.2.1 + Ember v1.10.0 (could work for earlier versions; but I haven't tried), this is how you do it:
exportdefault Ember.ObjectController.extend({
needs: ["restaurant/items"],
...
To access actions, you'd do this:
actions: {
myAction: function(arg1, arg2) {
this.get('controllers.restaurant/item').send('someItemActionYouDefine', arg1, arg2);
}
}
Post a Comment for "Accessing Ember-cli Nested Controllers"