Reputation: 716
I have two controllers as follow.
App.CreditIndexController = Ember.ArrayController.extend({
viewAll: function(){
//Some code
}
})
App.CreditVoucherController = Ember.ArrayController.extend({
needs: ['creditIndex'],
viewAllVoucher: function(){
this.get('controller.controllers.creditIndex').viewAll();
}
})
I was trying to access viewAll
function from CreditVoucherController
. But it didn't worked.
What is the way do it.
Upvotes: 0
Views: 47
Reputation: 11668
You have a to access another controller via the controllers property
:
App.CreditVoucherController = Ember.ArrayController.extend({
needs: ['creditIndex'],
viewAllVoucher: function(){
this.get('controllers.creditIndex').viewAll();
}
});
Upvotes: 1