mercredi 11 février 2015

Select current Array item after using `$filter` to see if it is even there


I have a stored procedure that returns a comma separated list of numbers. I take that and split it into an array


Using angular.forEach() I then need to search an array(scope.dataForStoreHierachy) for and id with the matching number.



var found = $filter('filter')(scope.dataForStoreHierachy, { id: parseInt(current) }, true);


That works fine, but is there a way to isolate that particular item within the array to look up other properties of the element?





Aucun commentaire:

Enregistrer un commentaire