I recently developed a multi-level tree in Angular with 3 levels. Currently, when the tree is loaded, only the first level is opened by default. Check out the demo here
My goal is to enable users to add or delete items within this tree, and whenever an action is performed, I want to ensure that it automatically opens up to level 1.
Although I tried using the following code snippet, it doesn't seem to work as expected:
@ViewChild('tree') tree;
ngAfterViewInit() {
this.tree.treeControl.expandAll();
}
If you have any suggestions or solutions on how to achieve this functionality, please let me know!