How to filter multiple values (OR operation) in angularJS

superares

New Member
I want to use the \[code\]filter\[/code\] 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 example this structure: An object \[code\]movie\[/code\] which has the property \[code\]genres\[/code\] and I want to filter for \[code\]Action\[/code\] and \[code\]Comedy\[/code\].I know I can do \[code\]filter:({genres: 'Action'} || {genres: 'Comedy'})\[/code\], but what to do if I want to filter it dynamically. E.g. \[code\]filter: variableX\[/code\]How do I set \[code\]variableX\[/code\] in the \[code\]$scope\[/code\], when I have an array of the genres I have to filter?I could construct it as a string and then do an \[code\]eval()\[/code\] but I don't want to use eval()...
 
Top