diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index dbda75ca29..829a1ad23e 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -1,4 +1,3 @@ - /** * @ngdoc overview * @name ui.bootstrap.tabs @@ -300,15 +299,18 @@ angular.module('ui.bootstrap.tabs', []) require: '^tabset', templateUrl: 'template/tabs/tabset-titles.html', replace: true, - link: function(scope, elm, attrs, tabsetCtrl) { - if (!scope.$eval(attrs.tabsetTitles)) { - elm.remove(); - } else { - //now that tabs location has been decided, transclude the tab titles in - tabsetCtrl.$transcludeFn(tabsetCtrl.$scope.$parent, function(node) { - elm.append(node); - }); - } + link: function (scope, elm, attrs, tabsetCtrl) { + //tabsetCtrl.$scope could be null + attrs.$observe(tabsetCtrl.$scope, function () { + if (!scope.$eval(attrs.tabsetTitles)) { + elm.remove(); + } else { + //now that tabs location has been decided, transclude the tab titles in + tabsetCtrl.$transcludeFn(tabsetCtrl.$scope.$parent, function (node) { + elm.append(node); + }); + } + }); } }; });