In my current scenario, a dynamic number of tabs can be created. When a user clicks on an entry in a commands menu, a new pill-tab pair is added to the existing ones (Note: Bootstrap is used for styling).
The list of tabs is managed within an array in $rootScope. Whenever a new tab needs to be opened, an entry is simply added to the array using the push
method. An ng-repeat
directive handles the creation of pill-tab pairs.
Everything works smoothly, with tabs and pills being added successfully. However, I'm facing a challenge in setting the newly added tab as the active one immediately upon creation. This is because the creation (addition to the list) happens within a controller and the element is not yet recognized by the DOM.
I considered using a timer, but found this approach to be quite messy and inefficient.