I am upgrading an Angular app to version 19. After the upgrade, I found out that NestedTreeControl
is deprecated. Even though it is still available, my IDE shows that
@deprecated Use one of levelAccessor or childrenAccessor instead. To be removed in a future version.
I wanted to replace the functionality by reading the official documentation but no luck; the documentation is not complete, and comments suggest to replace it with childrenAccessor
, but some of the functionalities, like
this.treeControl.expand(node);
are not available anymore in childrenAccessor
.
I cannot provide the source code, but I would appreciate it if anyone could give some examples with Angular 19 and Material Components v3 that show how we can use nodes' expanded functionality in the newer version of the Tree component.