docs-bug(tree): Replace deprecated NestedTreeControl in example code
Documentation Feedback
The example code for the nested tree uses the deprecated NestedTreeControl. Please replace it to show users how to implement a nested tree without it.
Affected documentation pages
- https://material.angular.io/components/tree/overview#nested-tree
- https://material.angular.io/cdk/tree/overview#nested-tree
Never mind, I found #27626 and #29062 which resolved this issue. I forgot to click on the examples tab in the documentation and was confused why the example in the first tab still used the deprecated class.
I'm very confused as I still can't find any examples using the new API on the examples tab. It still looks like they are all using the deprecated treeControl. Am I missing something?
The one titled "Tree with nested nodes, using childAccessor" is using childrenAccessor instead of NestedTreeControl. However, the one titled "Tree with nested nodes" is still using NestedTreeControl.
I'm reopening this issue because I think having any examples using a deprecated api is an bug/oversight. At least the examples on the overview tab, the ones people stumble upon first, should be written in a way that doesn't give users deprecation warnings in their IDEs.
How strange. I'm on v18.2.3 of the docs looking at examples of the mat-tree on the examples tab. I can't see "Tree with nested nodes, using childAccessor" anywhere at all. I can only see "Tree with nested nodes" which is still using the treeControl.
https://material.angular.io/components/tree/examples
I've even looked at RC and Next version of the docs and can't see it there either. Is there another version I should be looking at?
Oh wait, I’ve just realized that the new examples are actually on the CDK Tree page in the CDK section of the docs: https://material.angular.io/cdk/tree/examples. It seems like an oversight that these haven’t been updated in the main components section.
I hadn’t thought to check the CDK docs, and I’m sure many others might do the same, only finding examples with the deprecated API.
It would be great if the main components section could also be updated to include the new examples and avoid confusion.
Sorry, I was referring to https://material.angular.io/cdk/tree/examples. The components and the cdk have similar looking documentation which confuses me sometimes.
Well, I am trying to work with a child accessor but I am confused about how to expand particular nodes or expand decedents manually earlier it was like tree control. expand(node) or tree control. expand decedents (node). Any help would be appreciated
Fixed by #29752.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.