Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs-bug(tree): Replace deprecated NestedTreeControl in example code #29621

Closed
Farbfetzen opened this issue Aug 22, 2024 · 9 comments
Closed
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team

Comments

@Farbfetzen
Copy link

Farbfetzen commented Aug 22, 2024

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

@Farbfetzen Farbfetzen added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Aug 22, 2024
@Farbfetzen
Copy link
Author

Farbfetzen commented Aug 22, 2024

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.

@chrissena
Copy link

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?

@Farbfetzen
Copy link
Author

Farbfetzen commented Sep 10, 2024

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.

@Farbfetzen Farbfetzen reopened this Sep 10, 2024
@chrissena
Copy link

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?

@chrissena
Copy link

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.

@Farbfetzen
Copy link
Author

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.

@harish8895
Copy link

harish8895 commented Sep 12, 2024

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

@crisbeto
Copy link
Member

Fixed by #29752.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs This issue is related to documentation needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

4 participants