I need to update template from action. But I use two controllers on one page.
In my template I show a text:
{{myText}}
My controller:
export default Ember.Controller.extend({
myText: 'Hi',
init: function() {
....
},
actions: {
reload: function() {
this.set('myText', 'Bye');
}
}
...
I change it from another controller from someFun:
export default Ember.Controller.extend({
needs: ['another'],
someFun: function() {
this.get('controllers.another').send('reload');
}
});
It calls reload action (I tested). But it doesn’t change template. It still shows Hi but should change to Bye. Also reload action calls init
.
Ember version is 1.8