I'm new to angularjs. In my json data there are two objects categories and sub_categories.
{
"status": true,
"data": {
"categories": {
"1": "Fasteners",
"2": "Paints",
"3": "Abrasives"
},
"sub_categories": {
"1": [
"Select All",
"Nuts",
"Bolts",
"others"
],
"2": [
"All",
"Industrial Paints",
"Primer"
],
"3": "3",
"4": "4"
}
}
}
I need to map the sub_categories under respective categories. I can get the key values of categories and sub_categories byng-repeat="(keyCat,cat) in myData.data.categories " and ng-repeat = "(keySubCat,subCat) in myData.data.sub_categories" respectively but I'm not able to find a way to map them.
Can anyone please give a possible solution or guide me how to map these two objects.
My 2nd question is how can I implement a search to this json objects. This is not a json array so I'm not be able to use filters.