javascript - How to expand all nodes that has a children on page load by default in wix angular tree control -


has tried expand nodes has children on page load default in tree created angular tree control. packed lots of features lacks one. having expanded nodes property. need find array of nodes has children other logic , has pass same expanded nodes? correct logic or missing inbuilt functionality in directive? please help

http://wix.github.io/angular-tree-control/

in order load nodes expanded, have create list of node objects should expanded default , pass expanded-nodes attribute in html

controller script as:

    $scope.dataforthetree = [{         text: "data sources",         children: [{             text: "hard drive health",             children: []         }]     }, {         text: "diagrams",         children: [{             text: "hard drive failure example",             children: []         }]     }];      $scope.expandednodes = [vm.dataforthetree[0],vm.dataforthetree[1]]; 

html element as:

 <treecontrol class="tree-classic" tree-model="dataforthetree" expanded-nodes="expandednodes">                     {{node.text}}                 </treecontrol> 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -