lundi 5 janvier 2015

How I can filter a array by another array with EmberJs

I'm new with emberjs.


I've two arrays in filterActivities function



filterActivities: (->
activities = @get('activities') //get ['farmer', 'rancher']
producers = @get('producerTypes') //get [code: 'farmer', name: 'agriculutor', etc...]

filtering = producers.filter(producers) =>
activities.contains(producers.get('code'))
).property('producerTypes.@each')


how I can filter producers by activities using the method filter of ember.


Thanks!!





Aucun commentaire:

Enregistrer un commentaire