<li ng-repeat="phone in phones | filter:query"> Do you mean something like this?
Do you mean something like this?
--To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/QWGwq3w6GFUJ.
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.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
<li ng-repeat="phone in phones | filter:{name:query,snippet:query}"> Excellent!. Thanks..the filterFunction is precisely what I need.
On Mon, Apr 30, 2012 at 4:13 AM, Pawel Kozlowski <pkozlowski.opensource@gmail.com> wrote:
Hi!
If you specify a string as a filer property it will act on all object
On Mon, Apr 30, 2012 at 5:24 AM, superabe superabe <supe...@gmail.com> wrote:
> E.g. I would like to specify filter act on properties x and y, so that if I
> search for "Bar", the filter result would contain both objects below.
>
> {x: "Foo Bar", y: "Foo Baz", z: "Something Else"}
> {x: "Foo Baz", y: "Baz Bar", z: "Something Else"}
properties, see the jsFiddle: http://jsfiddle.net/tCL9z/2/
If, on the other hand, you would like to limit filtering to certain
properties only you could specify a filtering function:
http://jsfiddle.net/pkozlowski_opensource/tCL9z/15/ (just an example,
should be robust in reality).
This doc article explain all the options you've got:
http://docs-next.angularjs.org/api/angular.module.ng.$filter.filter
Hope this helps,
Pawel
--
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+unsubscribe@googlegroups.com.
Why not embrace the power of Angular :)<ling-repeat="phone in phones | filter:{name:query,snippet:query}">
To be honest, I just found that out after I was trying to create the above mentioned filter function ;)