Here's the link to demonstrate my problem: http://codepen.io/pietrofxq/pen/ZLLJdr?editors=1010
Click in "remove tabs" and then in "add tab"
The issue: I do a loop with ng-repeat to display tabs. But there may be a time when there's no items in the array, and when I add one tab back, I'd like this tab to come already selected, because it's the only one in the tabs array. The behavior now is that I have to click in the tab to angular to know that that tab is selected. How can I make this tab selected when I add it in the array?