The ui.bootstrap.tabs when using ng-repeat
Bug description:
The tab.index of UibTabsetController.tabs array is not set after the tab being destroy.
That cause the index of UibTabsetController.tabs is not correct with the index at View(html).
Link to minimally-working plunker that reproduces the issue:
http://plnkr.co/edit/kal8TDVoRLT7417GOLXd
Version of Angular, UIBS, and Bootstrap
Angular: version 1.5.0
Bootstrap: ui-bootstrap-tpls-1.2.4.js
At first glance, this looks like a bug.
It is because the index at view is changed, but the index at tabs is not updated. I think the Index attribute must be watched and update to the tabs.
Relying on dynamic index values leads to a world of pain - I'd recommend against doing so. I'm taking a look at potentially allowing dynamic indices, but it looks like it causes far uglier bugs unsurprisingly.
This may potentially be rejected as a not supported case, will look into this a little further.
After spending some time working on this and thinking on it, I am going to close this as won't fix. Relying on tab index values being dynamic & not unique is a use case that has fundamental problems when it comes to active state management when tabs are removed and added.
Wesley Cho. The document say the index is UNIQUE. So i think we could solve the problem by determine the index is unique and the model (scope) is change following the Index.
After removing item from tab creating deep copy of array will fix this issue.
Working link : http://plnkr.co/edit/FRqvpsRGk6HxdrqdTKx6?p=preview