I am working in Angular ,
- Where I have created a tree based structure
- on going down to tree structure there is a dropdown button name "Dropdown"
- Problem is on clicking to "Dropdown" button multiple dropdown is opening at same time
- Kindly check I am putting stackblitz link below for the code
https://stackblitz.com/edit/angular-tree-un?file=src%2Fapp%2Fapp.component.html
The button needs to toggle the corrosponding node. Everytime the dropdown button is clicked the value which determines if the dropdown should change in the node. Add isSelected as a property to the nodes and check if a node should show based on this property. Im not sure why you handle that vaccant node like that but the normal nodes should just work like this. Using Akhil's code since you've already tested it adjust it to this: