mardi 26 janvier 2016

Changing the view of a div created by loop without re-running the loop in ember.js

How can I change the view of a created by a loop which observes a change in its attribute , without changing the view of other created by the loop .

I am looping an array variable to display a set of list in each div .

{{#each val in property1}}

    <div class="grid1">
       {{val.value}}
     </div>
{{/each}}

Suppose my property1 looks like this

  property1:function(){
   array1 = [{
      value:'person1',
      address:'place1' 
  },
   {
      value:'person2',
      address:'place2' 
  }] 
 return array1;
}.property('flagValue')

Now the on changing the flagValue , property1 is called again and the DOM also gets updated. HOW CAN I OBSERVE THE address of a particular index in array1 object and change the view of the associated to that index without re-running the whole loop again.




Aucun commentaire:

Enregistrer un commentaire