New to Kendo UI for Angular? Start a free 30-day trial
NodeTemplateDirective
Represents the template for TreeView nodes (more information and example).
Use this template to customize the content of the nodes. To define the node template, nest an <ng-template>
tag with the kendoTreeViewNodeTemplate
directive inside a <kendo-treeview>
tag.
The template context provides the node data item and its hierarchical index as variables:
let-dataItem
—The data item for the current node.let-index="index"
—The hierarchical index of the current node.
html
<kendo-treeview>
<ng-template kendoTreeViewNodeTemplate let-dataItem let-index="index">
<span [style.fontWeight]="dataItem.items ? 'bolder': 'normal' ">
{{ index }}: {{ dataItem.text }}
</span>
</ng-template>
</kendo-treeview>
Selector
[kendoTreeViewNodeTemplate]