How to filter multiple values (OR operation) in angularJS

前端 未结 20 862
清酒与你
清酒与你 2020-11-22 10:01

I want to use the filter in angular and want to filter for multiple values, if it has either one of the values then it should be displayed.

I have for

20条回答
  •  隐瞒了意图╮
    2020-11-22 10:21

    The quickest solution that I've found is to use the filterBy filter from angular-filter, for example:

       
    
    • {{movie.name}} ({{movie.genre}}) - {{movie.rating}}

    The upside is that angular-filter is a fairly popular library (~2.6k stars on GitHub) which is still actively developed and maintained, so it should be fine to add it to your project as a dependency.

提交回复
热议问题