Want to get controller in needs which is nested controllerName in EmberJS? You should use camel case, not dot notation for this.
Here is an example:
1 2 3 4 5 6 7 8 9 10 11 | App.PackController = Ember.ObjectController.extend({ needs: ['packQuery'], queryPack: function () { var packQueryCtrller = this.get('controllers.packQuery'); Ember.debug('packQueryCtrller: ' + packQueryCtrller); //DEBUG: packQueryCtrller: undefined packQueryCtrller.queryPack(); //faild packQuery is undefined } }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.