I am looking for a way to bind data from a three-dimensional array in an area with my view.
My area (short version) is as follows:
$scope.publicationData = [
{ pubId:'1' , pubName:'Level 1 A' , pubCat:[
{ pubCatId:'1' , pubCatName:'Level 2 A', pubSubCat:[
{ pubSubCatId:'1' , pubSubCatName:'Level 3 A' },
{ pubSubCatId:'2' , pubSubCatName:'Level 3 B' }
]
},
{ pubCatId:'2' , pubCatName:'Level 2 B', pubSubCat:[
{ pubSubCatId:'3' , pubSubCatName:'Level 3 C' },
{ pubSubCatId:'4' , pubSubCatName:'Level 3 D' }
]
}
]
}];
In the view, I have code that successfully represents what is in the first and second dimensions of the array, but I cannot get the values ββfrom pubSubCatId or pubSubCatName
HTML + Angular View
<div ng-controller="myPublictionCtrl">
<div ng-repeat="publication in publicationData">
<ul>
<li >
{{publication.pubId}}. {{publication.pubName}}
</li>
</ul>
<ul>
<li ng-repeat="category in publication.pubCat">
{{category.pubCatId}}. {{category.pubCatName}}
</li>
</ul>
<ul>
<li ng-repeat="subcategory in publication.pubCat.pubSubCat">
{{subcategory.pubSubCatName}}
</li>
</ul>
</div>
</div>
How to get data from deeper layers of an area. Can AngularJS do this?
source
share