Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

Each space is an object with a boolean attribute called open, and I'm putting them into two lists. In this case, I have two of them, one is true and one is false. When the list renders at all, both items are in the open list. Here's what I've tried:

ng-repeat="space in ctrl.manager.spaces | filter:open"
ng-repeat="space in ctrl.manager.spaces | filter:!open"

and

ng-repeat="space in ctrl.manager.spaces | filter:open:true"
ng-repeat="space in ctrl.manager.spaces | filter:open:false"

and

ng-repeat="space in ctrl.manager.spaces | filter:{'open':true}"
ng-repeat="space in ctrl.manager.spaces | filter:{'open':false}"

{{space.open}} confirms that one is true and one is false.

share|improve this question
    
I just tried it using a predicate function in my controller, but the problem there is that the lists are not rerendered when the value changes, presumably because Angular doesn't know what to observe (it's hidden in the function). – Derecho Oct 31 '14 at 8:40
    
Although rendering the field as a test using my predicate function, {{ctrl.isOpen(space)}}, does update just fine. – Derecho Oct 31 '14 at 9:03
    
Have you tried filter:{space.open:true}? – Øystein W. Oct 31 '14 at 9:16
    
That throws an exception -- it's expecting a colon, not a dot. If I quote space.open, it complains that Space doesn't have a space method, but as in the original post, 'open' doesn't work. – Derecho Oct 31 '14 at 9:20
    
filter:{open:true} : stackoverflow.com/questions/17655837/… – Øystein W. Oct 31 '14 at 9:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.