opened.html 491 B

123456789101112
  1. <script type="text/ng-template" id="tree_item_renderer.html">
  2. {{data.name}}
  3. <button ng-click="add(data)">Add node</button>
  4. <button ng-click="delete(data)" ng-show="data.nodes.length > 0">Delete nodes</button>
  5. <ul>
  6. <li ng-repeat="data in data.nodes" ng-include="'tree_item_renderer.html'"></li>
  7. </ul>
  8. </script>
  9. <ul ng-app="Application" ng-controller="TreeController">
  10. <li ng-repeat="data in tree" ng-include="'tree_item_renderer.html'"></li>
  11. </ul>