Closed
Description
Reproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/components-issue-dew9or
Steps to reproduce:
- Just look at console log after it (tree) loads. Contents of the tree are not a subject of the issue - only the console error.
ERROR TypeError: "_co.treeControl.getLevel is not a function"
Expected Behavior
API notes presence of level property - for both flat and nested nodes.
https://material.angular.io/components/tree/api#MatNestedTreeNode
treeControl.getLevel(dataNode)
should be able to retrieve it, right?
Actual Behavior
Using:
{{treeControl.getLevel(dataNode)}}
...is apparently broken? Or not documented well.
I've also tried accessing "level" property through:
@ViewChildren(MatNestedTreeNode)
nestedNodes: QueryList<MatNestedTreeNode<Privilege>>;
...but it always returns 0, no matter when or what node You ask.
It seems like level property is never set, nor supported by treeControl.
Should or will level property be supported in nested nodes?
Environment
- Angular: 8.2.14
- CDK/Material: 8.2.3
- Browser(s): Any/All (tested on Firefox)
- Operating System (e.g. Windows, macOS, Ubuntu): Any/All