Another approach is the create a custom filter with a name like objToArr that 
takes an object and returns an array containing the values of its properties. 
Then you do this:

ng-repeat="item in borrowedItems | objToArr | filter:{contactId:'some-value'}"

---
R. Mark Volkmann
Object Computing, Inc.

> On Mar 5, 2014, at 6:02 AM, Marc B <[email protected]> wrote:
> 
> borrowedItems is _not_ an array but an object returned from FireBase. I guess 
> that's the problem.
> 
> I came up wiuth a custom filter :
> 
> <tr ng-repeat="item in borrowedItems | 
> propertyFilter:'contactId':contact.$id">
> 
> where propertyFilter is
> 
> angular.module("iShareApp")
> .filter('propertyFilter',function(){
>       return function(items,property,value){
>               var arr = [];
>               for(var item in items){
>                       if(items[item][property] == value){
>                               arr.push(items[item]);
>                       }
>               }
>               return arr;
>       }
> })
> 
> This shows the 1 element that points to the contact I want to filter on.
> 
> If the filter:{property:value} filter is only valid when working with arrays 
> I guess I should do an 'orderByPriority' first...
> -- 
> You received this message because you are subscribed to the Google Groups 
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to