Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

How to get json array from json array

$
0
0

I have json array to show category and subcategories and sub-subcategories

and i want show ALL of sub Subcategories with ng repeat

[
{
"id": "9",
"name": "Mobile",
"subCategories": [
{
"subCategoryId": "10",
"subCategoryName": "Apple",
"subSubCategories": [
{
"subSubCategoryId": "28",
"subSubCategoryName": "iPhone 6"
},
{
"subSubCategoryId": "29",
"subSubCategoryName": "iPhone 6s"
},
]
},
{
"subCategoryId": "11",
"subCategoryName": "Samsung",
"subSubCategories": []
},
]
}
]

My Controller

.controller('CatsCtrl', function($scope, $http) {
$http.get('api/categories').then(function(resp) {
console.log('Success', resp);
$scope.cats = resp.data;
}, function(err) {
console.error('ERR', err);
$scope.cats = err;
})
})

HTML View

<ion-content class="padding">
<div ng-repeat="item in cats">
{{item.subCategories[0].subCategoryName}}
</div>
</ion-content>


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>