mardi 22 novembre 2016

Ember, #if item.value inside #each, when value changed, the page did not update

   setupController: function(controller, model) {
      controller.set('testItem', [
        Em.Object.create({name: 'aaa', hilight: false}),
        Em.Object.create({name: 'BBB', hilight: true}),
        Em.Object.create({name: 'ccc', hilight: false})
      ]);
    },

I set setupController in the route.

 changeTest: function(item){
    item.hilight = !item.hilight;
 },

And this action in the controller. The handlebar code is like this:


    
        <div>
            <h4></h1>
        </div>
    
        <div>
            <i></i>
        </div>
    
    <button ></button>


The action function is executed successfully when I click the action, but page could not be updated.

So, what is the problem?




Aucun commentaire:

Enregistrer un commentaire