Skip to content

Commit 2034650

Browse files
committed
docs(material/tree): fixed mixed node types
Fixes docs that were combining flat and nested tree nodes.
1 parent ff26e6a commit 2034650

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

src/components-examples/material/tree/tree-nested-child-accessor-overview/tree-nested-child-accessor-overview-example.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
* Leaf nodes need to have padding so as to align with other non-leaf nodes
2222
* under the same parent.
2323
*/
24-
.example-tree div[role=group] > .mat-tree-node {
24+
.example-tree div[role=group] > .mat-nested-tree-node {
2525
padding-left: 40px;
2626
}

src/components-examples/material/tree/tree-nested-child-accessor-overview/tree-nested-child-accessor-overview-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- This is the tree node template for leaf nodes -->
33
<!-- There is inline padding applied to this node using styles.
44
This padding value depends on the mat-icon-button width. -->
5-
<mat-tree-node *matTreeNodeDef="let node">
5+
<mat-nested-tree-node *matTreeNodeDef="let node">
66
{{node.name}}
7-
</mat-tree-node>
7+
</mat-nested-tree-node>
88
<!-- This is the tree node template for expandable nodes -->
99
<mat-nested-tree-node
1010
*matTreeNodeDef="let node; when: hasChild"

src/components-examples/material/tree/tree-nested-child-accessor-overview/tree-nested-child-accessor-overview-example.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,33 @@ interface FoodNode {
1515
const TREE_DATA: FoodNode[] = [
1616
{
1717
name: 'Fruit',
18-
children: [{name: 'Apple'}, {name: 'Banana'}, {name: 'Fruit loops'}],
18+
// children: [{name: 'Apple', children: []}],
19+
children: [],
1920
},
2021
{
2122
name: 'Vegetables',
2223
children: [
2324
{
2425
name: 'Green',
25-
children: [{name: 'Broccoli'}, {name: 'Brussels sprouts'}],
26-
},
27-
{
28-
name: 'Orange',
29-
children: [{name: 'Pumpkins'}, {name: 'Carrots'}],
26+
// children: [{name: 'Broccoli'}, {name: 'Brussels sprouts'}],
27+
children: [],
3028
},
29+
// {
30+
// name: 'Orange',
31+
// // children: [{name: 'Pumpkins'}, {name: 'Carrots'}],
32+
// children: [],
33+
// },
3134
],
3235
},
3336
];
3437

38+
// Object.defineProperty(TREE_DATA[0], 'children', {
39+
// get: () => {
40+
// debugger;
41+
// return [];
42+
// },
43+
// });
44+
3545
/**
3646
* @title Tree with nested nodes (childrenAccessor)
3747
*/

src/components-examples/material/tree/tree-nested-overview/tree-nested-overview-example.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
* Leaf nodes need to have padding so as to align with other non-leaf nodes
2222
* under the same parent.
2323
*/
24-
.example-tree div[role=group] > .mat-tree-node {
24+
.example-tree div[role=group] > .mat-nested-tree-node {
2525
padding-left: 40px;
2626
}

src/components-examples/material/tree/tree-nested-overview/tree-nested-overview-example.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- This is the tree node template for leaf nodes -->
33
<!-- There is inline padding applied to this node using styles.
44
This padding value depends on the mat-icon-button width. -->
5-
<mat-tree-node *matTreeNodeDef="let node">
5+
<mat-nested-tree-node *matTreeNodeDef="let node">
66
{{node.name}}
7-
</mat-tree-node>
7+
</mat-nested-tree-node>
88
<!-- This is the tree node template for expandable nodes -->
99
<mat-nested-tree-node
1010
*matTreeNodeDef="let node; when: hasChild"

0 commit comments

Comments
 (0)