for example i have a controller like this :
App.theController = Ember.ArrayController.extend({
methodA:funtcion() {},
actions: {
methodB:function(){},
methodC:function(){}
}
});
my questions is :
You have to use this. send([methodName]) in order to get your methods called correctly: var App = Ember. Application.
You have to use this.send([methodName])
in order to get your methods called correctly:
var App = Ember.Application.create({
ready: function() {
console.log('App ready');
var theController = App.theController.create();
theController.send('methodC');
}
});
App.theController = Ember.ArrayController.extend({
methodA:function(){
//How can methodA calling methodB
this.send('methodB');
console.log('methodA called');
},
actions:{
methodB:function(){
//How can methodB calling methodC
this.send('methodC');
console.log('methodB called');
},
methodC:function(){
console.log('methodC called');
}
}
});
Here a simple jsbin as a playground.
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With