I have a $scope array variable that I'm using to generate tabs on the front end, but I'm struggling with implementing a remove tab function. The code for removing tabs is as follows:
function removeTab(index) {
$scope.tabs.splice(index, 1);
};
For creating the tabs, here is the code snippet:
<tabset class="tab-container">
<tab id = "tabContent" ng-repeat="tab in tabs" active="tab.active" ng-select="select"> <!-- the tab highlight directive -->
<tab-heading>
<span>{{tab.title}}</span>
<i class="glyphicon glyphicon-remove" ng-click="removeTab($index)"></i> <!-- the tab close button -->
</tab-heading>
<textarea ui-codemirror= "{ onLoad : codemirrorLoaded }"></textarea>
</tab>
</tabset>
When I attempt to close a single tab using the removeTab button after opening multiple tabs, all tabs unexpectedly close along with the console clearing itself. It's a puzzling issue that I am currently investigating.
Thank you for your assistance!