0.0.5 • Published 7 years ago

@lkmylin/angular-treeview v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

angular-treeview

This project was generated with Angular CLI version 1.6.4. It uses ng-packagr to create a portable, AOT-compatible component library for Angular apps.

Installation

Run npm install @lkmylin/angular-treeview --save

Run npm install @lkmylin/angular-statemanager --save

Implementation

In your bootstrap module:

  • import { TreeviewModule } from "@lkmylin/angular-treeview";

  • import { StateManagerModule, StateManager } from "@lkmylin/angular-statemanager";

  • add StateManager to your providers

  • add {provide: "window", useValue: window} to your providers

  • add a TreeviewComponent: <lkm-treeview treeid="myTree" datasource="assets/treeData.json"></lkm-treeview>

  • treeData.json should be an array of objects with the following properties:

    • TreeKey: number;

    • ParentKey: number; (The TreeKey of the parent node, or zero for root nodes)

    • Title: string;