How to use a filter for ng-repeat

2,552 views
Skip to first unread message

wingy

unread,
Aug 6, 2012, 2:13:02 AM8/6/12
to ang...@googlegroups.com
Does anyone know why I can't make the filter work?


Wingy

Pawel Kozlowski

unread,
Aug 6, 2012, 2:34:17 AM8/6/12
to ang...@googlegroups.com
Hi!

On Mon, Aug 6, 2012 at 8:13 AM, wingy <johnn...@yobistore.com> wrote:
> Does anyone know why I can't make the filter work?
>
> http://plunker.no.de/edit/brlYn2?live=preview

It doesn't work since the 'filter' filter can only be used with array
sources, checks the docs
(http://docs.angularjs.org/api/ng.filter:filter): "array – {Array} –
The source array" and the sources:
https://github.com/angular/angular.js/blob/master/src/ng/filter/filter.js#L85

To make it work you would have to change your data structure or write
a custom filter
(http://docs.angularjs.org/guide/dev_guide.templates.filters.creating_filters).

Cheers,
Pawel

Johnny Luu

unread,
Aug 6, 2012, 3:43:40 PM8/6/12
to ang...@googlegroups.com
Is this considered as a missing feature or will object support be added in the future you think?

Thanks for the link. I'll try that out.

Wingy


--
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.
Visit this group at http://groups.google.com/group/angular?hl=en.



Reply all
Reply to author
Forward
0 new messages