Angular 4 Tree
- npm install --save-dev a4-tree
In your app.module.ts
@NgModule({
imports: [
...
TreeModule.forRoot(),
...
],
<ng2tree [root]="root"></ng2tree>
root must be a TreeNode
export interface TreeNode {
id: string;
text: string;
ngClass: string;
children: TreeNode[] | null;
expanded?: boolean;
loading?: boolean;
}