suman goud

suman goud

  • NA
  • 176
  • 54k

how to bind tree structure to accordion using angular

Dec 16 2016 12:20 AM

how to bind tree structure to accordion using angular in tree structure like parent child , how to get this, am able to bind complete list angular code

 
angular code
$scope.groups = [
{
ID: 1,
Name: "parent",
ParentID:0
},
{
ID: 2,
Name: "child",
ParentID: 1
},
{
ID: 3,
Name: "subchild1",
ParentID: 2
},
{
ID: 4,
Name: "subchild2",
ParentID: 2
}
];
view
<uib-accordion close-others="oneAtATime">
<div uib-accordion-group class="panel-default" ng-repeat="grp in groups" is-open="status.open">
<uib-accordion-heading>
{{grp.Name}} <i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': status.open, 'glyphicon-chevron-right': !status.open}"></i>
</uib-accordion-heading>
{{grp.Name}}
</div>
</uib-accordion
 

Answers (2)