Ember.js How to get controller in needs which is nested controllerName
I want to use this.get('controllers.pack.query'); to get App.PackQueryController in App.PackController , but failed. I think the problem is Ember use pack not pack.query as controllerName when it tries to get the controller. Although I can get the controller by this.controllerFor('pack.query') , but Ember says it is deprecated, please use needs instead My router map likes below and I've defined needs: ['pack.query'] in App.PackController App.Router.map(function () { this.resource('pack', function () { this.route('index', {path: '/:pack_id'}) this.route('query'); }); }); App.PackController =