0.1.2 • Published 8 years ago

angular-lazy-tree v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

angular-lazy-tree

Features

  • Flexible: Each nodes can be control by its controller if you want.
  • No configurations: Just few data-bindings and one template.
  • Lazy loadable: Easy to implement lazy loading.

Installation

NPM: npm install angular-lazy-tree

ES6 way

import * as angular from 'angular';
import { TreeModule } from 'anuglar-lazy-tree';

angular.module('app', [TreeModule.name]);

Traditional way

Load script in your html.

<script src="path/to/node_modules/angular-lazy-tree/lib/index.umd.js"></script>

Add tree to your application module as a dependency.

angular.module('myApp', ['tree']);

Usage

  • <tree> the tree element which refer to nodes to be display.
  • [tree-node-template] the template of a node.
<tree nodes="nodes">
  <ul tree-node-template>
    <li>{{$node.name}}</li>
    <li>
      <ul>
        <li ng-repeat="child in $node.children" tree-node node="child"></li>
      </ul>
    </li>
  </ul>
</tree>