mat-tree
Quickly ! ! !
Proposing code design:
JSON Example:
{
"data": [{
"label": "Tree Item Collapsed",
"data": "Tree Item Collapsed Data",
"expandIcon": "fa-folder-open",
"collapseIcon": "fa-folder",
"children": []
}, {
"label": "Tree Item Expanded",
"data": "Tree Item Expanded Data",
"expandIcon": "fa-folder-open",
"collapseIcon": "fa-folder",
"children": [{
"label": "Bookmarks",
"data": "Bookmarks Data",
"icon": "fa-bookmarks"
}, {
"label": "Chart",
"data": "Chart Data",
"expandedIcon": "fa-chart"
}]
}, {
"label": "Bookmarks",
"data": "Bookmarks Data",
"icon": "fa-bookmarks"
}, {
"label": "Chart",
"data": "Chart Data",
"expandedIcon": "fa-chart"
}]
}
Attributes:
data - Data array of treenodes
selectionType - Selection type, "single", "multiple", maybe "checkbox?".
selection - Single treenode instance or an array to refer to the selections.
orientation - Tree orientation.
Events:
nodeExpand - Callback to invoke when a node is expanded.
nodeCollapse - Callback to invoke when a node is expanded.
nodeSelect - Callback to invoke when a node is unselected.
nodeUnselect - Callback to invoke when a node is selected.
Lazy Loading?
Drag-n-Drop?
Looking forward to the release of the Tree!!
Will try to implement this weekend.
The tree component's design and implementation are in-progress.
@tinayuangao , thanks for info, will wait for updates.
Too slowly!
@vyakymenko The status for the tree in README.md still 'Not started'
@alvachien , because I have not started it per comment from @tinayuangao:
The tree component's design and implementation are in-progress.
While a official <md-tree> is developed, I find out "angular-tree-component".
It supports templates & themes (eg putting <md-icon> and/or <md-checkbox> into it)

https://angular2-tree.readme.io/docs
@alescdb angular2-tree-component works fine for me, however I wasn't able to find any custom icons (e.g. file or folder icon before labels) inclusion in documentation. Do you have any such example? Appreciate help.
@ajaysattikar; using a custom template (https://angular2-tree.readme.io/docs/templates) should do the trick, something that looks like that :
<tree-root [nodes]="nodes">
<ng-template #treeNodeTemplate let-node let-index="index">
<md-icon>{{ node.data.icon }}</md-icon>
{{ node.data.name }}
</ng-template>
</tree-root>
nodes should look like :
nodes = [
{
id: 1,
name: 'My Folder',
icon: 'folder'
children: [
{ id: 2, name: 'My File 1', icon: 'insert_drive_file' },
{ id: 3, name: 'My File 2', icon: 'insert_drive_file' }
]
},
{
id: 4,
name: 'Other Folder',
icon: 'folder'
}
];
I hope this help!
I have to say that I'm against using the generic data term. Everything is data and there is always a better description. Call it children or nodes or whatever. I like @alescdb structuring. It's clear and has no bloat.
EDIT: I think it would be nice if instead of icon we could put a component in there like a checkbox or radio button.
@alescdb It would be nice to have an indeterminate icon in the root folder if the user selected some items in its child nodes.
+1 @kara It would be nice to have an indeterminate icon before label
urgent need
Hi, @vyakymenko what will be the design for grand children ? will it be like we will add children in children object ?
For those following this thread, the sneak-peek implementation that the Material team has in mind can be found here.
The source code is not available, but it looks like it draws on new cdk-tree and cdk-node elements. The best comparison would be to say that it looks like a pretty-printer for JSON objects (with select option), using Material, and very similar to the angular2-tree linked above by @alescdb
looks realy nice, would be great to implement good drag'n'drop for nodes - that what is lacking most in other tree implementations i tried. angular2-tree for me is best i tried - but developers stopped supporting systemjs :(
