Create a tree list component with Angular2
npm install ng2-treelist(WIP) Getting comfy publishing Angular2 Components.
If you are interested in an Angular2 tree component, please use n2-tree
npm install --save ng2-treelist
After installing ng2-treelist. Import the Tree and Tree Model into your component.
``typescript
import {Tree, TreeModel} from 'ng2-tree/components';
@Component({
selector: 'app',
template:
})
export class App {
public tree: TreeModel[] = [
new TreeModel("Menu Item 1", [
new TreeModel("SubMenu Item 1", [
new TreeModel("SubSubMenu Item 1", []),
new TreeModel("SubSubMenu Item 2", [])
]),
new TreeModel("SubMenu Item 2", [])
]),
new TreeModel("Menu Item 2", []),
new TreeModel("Menu Item 3", [
new TreeModel("SubTreeModel 3", [])
])
];
}
``
TreeModel is will include your own tree nodes.
MIT © Malek Hakim