I see how to get static content in the body of the accordion, but I canβt figure out how to create dynamic content.
Taking an example at http://angular-ui.imtqy.com/bootstrap/ , the accordion is generated from ...
$scope.groups = [ { title: "Dynamic Group Header - 1", content: "Dynamic Group Body - 1" }, { title: "Dynamic Group Header - 2", content: "Dynamic Group Body - 2" } ];
What I want to achieve is to create an accordion from a two-tier structure, so ...
$scope.groups = [ { title: "Dynamic Group Header - 1", items: {[item-title: "item 1", item-title: "item 2"]} }, { title: "Dynamic Group Header - 2", items: {[item-title: "item 3", item-title: "item 4"]} } ];
Where each body of the accordion looks something like this: -
<div ng-repeat="item in group[n].items"><li>{{item.item-title}}</li></div>
Thus, the resulting HTML looks something like this: -
Dynamic Group Header - 1 . item 1 . item 2 Dynamic Group Header - 2 . item 3 . item 4
Everything I put in the content just seems to get an innerHtml instance without any processing.
source share