I'm trying to filter an select to only show options that have a
classification of 'User', however this checks if classification
contains 'User' which returns anything that has 'User' in it.
eg-> ng:options="opt.name for opt in references.
$filter({classification:'User'})"
Is there a way to filter for an exact match?
Thanks
Frank
I created this fiddle which is simplified version from the Array.filter live doc
http://jsfiddle.net/dandoyon/HRzAz/
http://docs-next.angularjs.org/api/angular.Array.filter
--dan
> --
> You received this message because you are subscribed to the Google Groups "AngularJS" group.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to angular+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/angular?hl=en.
>
Maybe I'm being unclear. What I mean is that, if I take your example
and change one of the color shades to be 'darker'
function MyCntrl() {
this.colors = [
{name:'black', shade:'dark'},
{name:'whiteblack', shade:'light'},
{name:'red', shade:'darker'},
{name:'blue', shade:'dark'},
{name:'yellow', shade:'light'}
];
}
when I type 'dark' into the search field it shows both 'dark' and
'darker' values. Is there a way to on display data based on an exact
match?
Thanks again.
Frank
> > For more options, visit this group athttp://groups.google.com/group/angular?hl=en.- Hide quoted text -
>
> - Show quoted text -