How to remove filter?

535 views
Skip to first unread message

Amitava Saha

unread,
Jun 10, 2013, 12:05:33 AM6/10/13
to ang...@googlegroups.com
I have a ng-repeat which shows only online users by default.
 ng-repeat="user in group.GroupMembers  | filter:user.online=true | filter:search
And if I search it will only search within online users. What I'd like to do is watch filter and if user enters filter text then I want to remove user.online filter so that it shows result from entire collection. So how do I remove a filter from controller?

Thanks!

Grant Rettke

unread,
Jun 10, 2013, 12:08:01 AM6/10/13
to ang...@googlegroups.com
Create a function in the controller to do the filtering, conditionally
filtering on the user input or else defaulting to your existing
condition.
> --
> 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 angular+u...@googlegroups.com.
> To post to this group, send email to ang...@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Grant Rettke | ACM, AMA, COG, IEEE
gre...@acm.org | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson
Reply all
Reply to author
Forward
0 new messages