Filtering if not equal to

9,690 views
Skip to first unread message

Brad McAlister

unread,
Mar 14, 2013, 5:39:00 PM3/14/13
to ang...@googlegroups.com
Can I do this? If I have a model and only want to filter out one group of say 3 I can do that by specifying each group I want to see. But what if I just want to exclude only one of group?

Tim Stewart

unread,
Mar 14, 2013, 6:24:20 PM3/14/13
to ang...@googlegroups.com
Hi Brad

You could add a controller with a filter function:


Regards
Tim

Brad McAlister

unread,
Mar 14, 2013, 6:29:59 PM3/14/13
to ang...@googlegroups.com
Thanks Tim! That makes much more sense than what I was trying to do.

Виталий Юрьев

unread,
Mar 11, 2014, 3:46:51 AM3/11/14
to ang...@googlegroups.com
You could use

filter:{group:'!group2'}

http://plnkr.co/edit/91gS57PugrjPD6Hl4CRL?p=preview


пятница, 15 марта 2013 г., 1:39:00 UTC+4 пользователь Brad McAlister написал:

César Barone

unread,
Mar 11, 2014, 7:06:42 AM3/11/14
to ang...@googlegroups.com
Hy, Brad, thanks for your response.

I improved my plunker to reflect better my problem. So, i have two arrays, one of users and other of selected users. In the select field, i need to show only not selected users yet. I wrote a filter, called arrayDiff to return the difference array, comparing by specific property. First time, when i selected an entry from select field, the implementation runs ok. But, after this, i got same issues, like problems to select a new user. Try it:


Thanks :)


--
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.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Mar 11, 2014, 8:42:22 AM3/11/14
to ang...@googlegroups.com
Hi Brad, César,

Ok, I gave it a quick shot. ES5 only. have a look at this:
http://plnkr.co/edit/UFOQpy?p=preview

Is it where you where looking of?

Regards
Sander

Виталий Юрьев

unread,
Mar 13, 2014, 9:59:00 AM3/13/14
to ang...@googlegroups.com
 Also, you could use one array of users. And each user will contain bool property isSelected.
I think, it seems easier (If you can use it in your project)

вторник, 11 марта 2014 г., 15:06:42 UTC+4 пользователь César Costa написал:

Виталий Юрьев

unread,
Mar 13, 2014, 9:59:50 AM3/13/14
to ang...@googlegroups.com
 Also, you could use one array of users. And each user will contain bool property isSelected.
I think, it seems easier (If you can use it in your project)

вторник, 11 марта 2014 г., 15:06:42 UTC+4 пользователь César Costa написал:
Hy, Brad, thanks for your response.

César Barone

unread,
Mar 15, 2014, 4:32:08 PM3/15/14
to ang...@googlegroups.com
Sander, Brad. 

I coded based on Sander suggestion. 

Thanks :)
Reply all
Reply to author
Forward
0 new messages