mardi 28 juin 2016

Can't update template from controller

I need to update template from action. But I use two controllers.

In my template I show a text:



My controller:

export default Ember.Controller.extend({
   myText: 'Hi',
   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.




Aucun commentaire:

Enregistrer un commentaire