For example, I have a list like this (which I use with ng-repeat):
var myList = [ {id: 1, name: 'Peter Ollison', type: 'Driver', status: 'Working'}, {id: 2, name: 'Maya Nameson', type: 'Manager', status: 'Not'}, {id: 3, name: 'Iki Jonny', type: 'Driver', status: 'Paused'}, {id: 4, name: 'Nikolay Ivanov', type: 'Manager', status: 'Working'}, {id: 5, name: 'Nikolay Ivanov', type: 'Sales manager', status: 'Not'}, {id: 6, name: 'Scotty Deperson', type: 'Boss', status: 'Working'}, ]
and I have filters:
nameFilter: ['Peter Ollison', 'Nikolay Ivanov'] typeFilter: ['Manager', 'Driver'] statusFilter: ['Working']
How is this possible in a filter function to combine all of these filters? And return only those items from the list that are equal to filters? BUT!!! I can:
filter only by name or only by type, or by 2 fields, or by all of them
How can I filter my list?
for example, if I filter by 3 filter arrays at a time, I should get the result:
[{id: 1, name: 'Peter Ollison', type: 'Driver', status: 'Working'}, {id: 4, name: 'Nikolay Ivanov', type: 'Manager', status: 'Working'}]
now I can filter only one value in the controller, and I got several field filters ((