Answer the question
In order to leave comments, you need to log in
How to make such a filter in angularjs 1?
Hello.
Simplified the code for clarity.
I get in angular json with a list of products:
[
{
"id": 1,
"name" : "Product1",
"prop1" : "prov1 val",
"prop2" : "prov2 val",
"prop3" : "prov3 val",
},
{
"id": 2,
"name" : "Product2",
"prop1" : "prov1 val",
"prop2" : "prov2 val",
"prop3" : "prov3 val",
},
...
]
$scope.props = {
prop1 : ["prov1_val" , "prov1_some_val" , "prov1_etc"],
prop2 : ["prov2_val" , "prov2_some_val" , "prov2_etc"],
prop3 : ["prov3_val" , "prov3_some_val" , "prov3_etc"],
}
Answer the question
In order to leave comments, you need to log in
IMHO, you don't need to do this on the frontend - extra traffic, useless load and devouring memory on the client.
Pass the list as a parameter to the server, return suitable products under this set of parameters and you will be happy: fast, beautiful, with pagination.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question