I have dinamic tabs (Angular UI Bootstrap) in my view this way:
<uib-tabset active="1" id="tabs" class="col-md-10">
<uib-tab ng-repeat="tab in filaCtrl.tabs" ng-click="filaCtrl.getChatTab(tab.protocolo)">
<uib-tab-heading >
<div style='display: flex; align-items: center; justify-content: center;'>
<h5 style='margin-right: 10px;'>Protocolo: {{tab.protocolo}}</h5>
<h7 ng-md-icon icon='cancel' style='fill:#F44336' size='16' ng-click='filaCtrl.closeTab(tab.protocolo, $index)'><h7>
<div>
</uib-tab-heading>
<div class="tab-content">
(...)
My function filaCtrl.closeTab() remove a tab, i.e., a item in array filaCtrl.tabs. But when a item is removed the view is updated and 'close' all tabs, i.e., refresh page.
self.closeTab = function (protocolo, $index) {
self.tabs.splice($index, 1);
};
How can i remove item without refresh my page?