After making some adjustments to the ui-bootstrap file, I was able to solve the issue.
Since I'm still relatively new to AngularJS, please excuse any unfamiliar terminology.
Although it's not a standard approach, this makeshift solution does get the job done.
Navigate to ui-bootstrap-tpls-0.10.0.js and locate the 'tab' directive :
.directive('tab', ['$parse', function($parse) {
return {
require: '^tabset',
restrict: 'EA',
replace: true,
templateUrl: 'template/tabs/tab.html',
transclude: true,
scope: {
id:'@', // PATCH : GETTING TAB 'id' ATTRIBUTE
heading: '@',
onSelect: '&select', //This callback is called in contentHeadingTransclude
//once it inserts the tab's content into the dom
onDeselect: '&deselect'
},
// ...
Take note of the added code for fetching the id attribute value (presumably through transclusion).
A few lines down, find :
scope.$watch('active', function(active) {
and modify it as follows :
scope.$watch('active', function(active) {
// This watcher also initializes and assigns scope.active to the
// attrs.active expression.
setActive(scope.$parent, active);
if (active) {
tabsetCtrl.select(scope);
scope.onSelect();
tab_id = attrs.id;
$(".tab_pane_"+tab_id).hide(); // HIDE AT FIRST, SO IT CAN ACTUALLY FADE IN
$(".tab_pane_"+tab_id).fadeIn(1000); // JQUERY TARGETING BY CLASS
} else {
scope.onDeselect();
tab_id = attrs.id;
$(".tab_pane_"+tab_id).hide(); // JQUERY TARGETING BY CLASS
}
});
Scroll a bit further down to find :
scope.select = function() {
Insert the following line inside the function :
$(".tab-pane").hide();
This ensures all tab panes are properly hidden initially.
Next, look for :
angular.module("template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) { ...
Add a CSS class to the tab-pane element in the corresponding template like so :
angular.module("template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("template/tabs/tabset.html",
"\n" +
"<div class=\"tabbable\">\n" +
" <ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\" ng-transclude></ul>\n" +
" <div class=\"tab-content\">\n" +
" <div class=\"tab-pane tab_pane_{{tab.id}}\" \n" + // CLASS NAME IS DYNAMIC
" ng-repeat=\"tab in tabs\" \n" +
" ng-class=\"{active: tab.active}\"\n" +
" tab-content-transclude=\"tab\">\n" +
" </div>\n" +
" </div>\n" +
"</div>\n" +
"");
}]);
Once you've modified the ui-bootstrap .js file, remember to update your view template (where you load the tabs) and specify the 'id' attribute :
<!-- TABS -->
<tabset justified="true">
<tab ng-repeat="tab in tabs" heading="{{tab.title}}" id="{{tab.id}}" >
// ... TAB CONTENT
The concept might seem crude at the moment, but it functions effectively.
If you're curious about how my tabs obtained IDs, I injected them through my controller :
Tab1 = {
id:1,
'ShortDescription': ShortDescription,
'FullDescription': FullDescription,
'TabContent': TabContent1,
title: "ProductTabTitleDefault1",
// active:true
};
Tab2 = {
id:2,
'ShortDescription': ShortDescription,
'FullDescription': FullDescription,
'TabContent': TabContent1,
title: "ProductTabTitleDefault2",
// active:true
};
$rootScope.tabs = {
'Tab1': Tab1,
'Tab2': Tab2,
};
Remember, this data is fictitious, but if your tabs and their content are dynamic, you can utilize a counter and consider using a different key instead of "id" (adjusting accordingly).