samedi 28 janvier 2017

Ember filter a list by property name

I have a an array coming from my model..

[
  {id: 1, name: 'test1', created: true}, 
  {id: 2, name: 'test2', created: false}, 
  {id: 3, name: 'test3', created: true}
]

I am interested showing two lists. I created a component to show the list:

../components/created.hbs

<div>
  
</div>


../main.hbs

<h2> Created true </h2>


   



<h2> Created false </h2>


   


The first list would show the the objects with the created property set to true and the second would show those with the created property set to false.

I was wondering if there was a simple way of doing the above in Ember as in Angular where you could use filter pipes inside the each block.




Aucun commentaire:

Enregistrer un commentaire