1.0.0 • Published 7 years ago

ng2-treelist v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

ng2-treelist

(WIP) Getting comfy publishing Angular2 Components.

If you are interested in an Angular2 tree component, please use n2-tree

install

npm install --save ng2-treelist

use

After installing ng2-treelist. Import the Tree and Tree Model into your component.

import {Tree, TreeModel} from 'ng2-tree/components';


@Component({
    selector: 'app',
    template: `
               <tree [tree]="tree"></tree>
               `
})

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.

License

MIT © Malek Hakim