There is a code:

<uib-accordion-group ng-repeat="li in list"> <uib-accordion-heading> <a ng-click="active(li.name)" href="{{li.link}}"><i class="fa" ng-class="li.icon"></i> {{li.name}}<i class="pull-right fa fa-angle-right" ng-show="li.submenu.length"></i></a> </uib-accordion-heading> <div> <ul class="childrenul"> <li ng-repeat="subitem in li.submenu">{{subitem}}</li> </ul> </div> </uib-accordion-group> </uib-accordion> 

It is taken from the array. But the essence is in the other, he creates the accordion menu, but I need not all the points of the accordion, but only those that have child items, but it transforms everything. How can I do that?

  • add an array to build on - Grundy
  • @Grundy, $ scope.list = [{name: 'Panel', icon: 'fa-tachometer', submenu: [], link: "#"}, {name: 'Editor', icon: 'fa-pencil- square-o ', submenu: [], link: "#"}, {name:' Other ', icon:' fa-pie-chart ', submenu: [' Lida ',' Objectives', 'Statistics']], link: "#"} - Sdafs Fasafs
  • That is, the output needs only the "Other" section? - mix
  • @mix, that is, the output? - Sdafs Fasafs
  • From the array you need to throw all the properties with an empty submenu ? - mix

0