DWQA QuestionsCategory: ProgramHow to use angular filter in controller
1351523628 asked 3 months ago
{{childrenarray | filter: 'a'}} // match the value containing a in the attribute value

How to use it in an angular controller.

,There are too few things to explain. The filter is to process the value. It’s not clear what you want to do after matching. It’s just to judge whether it matches?
Usage can refer toCustom filterpart.,I don’t know if you want this effect. I’ll show you the screenshot I wrote.
First you need to use custom filters.
Page:
clipboard.png
filter:
clipboard.png
Exhibition:
clipboard.png

2 Answers
toBeTheLight answered 3 months ago

There are too few things to explain. The filter is to process the value. It’s not clear what you want to do after matching. It’s just to judge whether it matches?
Usage can refer toCustom filterpart.

liuhy answered 3 months ago

I don’t know if you want this effect. I’ll show you the screenshot I wrote.
First you need to use custom filters.
Page:
clipboard.png
filter:
clipboard.png
Exhibition:
clipboard.png

1351523628 replied 3 months ago

Thank you for this custom filter, and then use it in the template. The other is used in the controller.
$filter(filtername)(input,param).

liuhy replied 3 months ago

Well, yes