here the point is, to implement the logic that how to find/filter out objects that matches with your input, either in different properties or in a single property, once you are able to write the logic, there is no big deal to create a angular filter.
here I am writing a filter assuming your objects are having flat structure.
since you want to filter when all the tokens founds in object, like "Android Meizu" will return the objects having "Android" in some field, and "Meizu" in some field, or "Android Meizu" al a whole in some field, we cal split it, and check that, if all tokens are sup part of any of the value of the object, we can take that object, that way both the criteria fullfiled. Here is a code sample that should work
.filter('detailSearch', function() {
return function(input, filterStr) {
//this will split to strings by space, if space is not there
//still it will wrap in array the single element
//the filter will remove empty strings if multiple spaces are there
var tokens = filterStr.split(" ").filter(function(s) {
return s
});
var op = input.filter(function(obj) {
//taking valuesassuming your object having flat structure,
//if all not strings converted to string and lower case
var values = Object.values(obj).map(function(v) {
return v.toString().toLowerCase()
});
var keysExistsInObj = tokens.filter(function(key) {
return values.some(function(v) {
return v.includes(key.toLowerCase())
});
});
//checking for all tokens exists
return keysExistsInObj.length === tokens.length;
});
return op;
}
})
Comment if anything is not clear.
Android Meizuwill find all having eitherAndroidorMeizuor it will find those having both?