/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components-examples/material/tree/tree-flat-overview/tree-flat-overview-example.html
19 строк
862 B
Olawuni Olagoke
docs(material/tree): update examples to use modern childrenAccessor API (#32751)
26 мар 2026, 16:42
Не верифицирован
26 мар 2026, 16:42
9055ac5
Код
Авторство
О чём код?
<mat-tree #tree [dataSource]="dataSource" [childrenAccessor]="childrenAccessor"> <!-- This is the tree node template for leaf nodes --> <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding> <!-- use a disabled button to provide padding for tree leaf --> <button matIconButton disabled></button> {{node.name}} </mat-tree-node> <!-- This is the tree node template for expandable nodes --> <mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding matTreeNodeToggle [cdkTreeNodeTypeaheadLabel]="node.name"> <button matIconButton matTreeNodeToggle [attr.aria-label]="'Toggle ' + node.name"> <mat-icon class="mat-icon-rtl-mirror"> {{tree.isExpanded(node) ? 'expand_more' : 'chevron_right'}} </mat-icon> </button> {{node.name}} </mat-tree-node> </mat-tree>