Let's assume I have the following tree structure:
Item1 Item2 Item3 Item4 Itemn
/ | \ / | \ / | \ / | \ / | \
/ | \ / | \ / | \ / | \ / | \
a b c d e f g h i j k l n-2 n-1 n
Each node from a,b,...,n has values. What's a more efficient approach to make the data accessible to a user?
My approach is he following:
Create an array toggleStatus that contains boolean values. Assign a number to each tab which is respectively equal to the index of toggleStatus. A method toggle(index) will toggle the value of toggleStatus at index index.
Please have a look at my Stackblitz for a working example.
from Efficient hyperlink management architecture approach in Angular
No comments:
Post a Comment