So, I have a set of company data stored in a variable in the controller.
$scope.companies = [ { name: "first company", type: ["a", "b"] }, { name: "second company", type: ["b"] }, { name: "third company", type: ["c"] } ]
Then I have a list where I want to list all companies either a or b. I thought sending and array would work as or-statement. It turns out this is more like an and-statement statement.
<ul> <li ng-repeat="company in companies | filter:filters{type: ['a', 'b']}"> {{company.name}} </li> </ul>
The code above will indicate “first company”, while I would like it to display both “first company” and “second company”. I know that I can manipulate the $ scope.companies dataset from the controller, but I would like to know if there is any “native” way to achieve this.
Yours faithfully! // Richard
source share