From 83ceb78a8b99cf9a1138709660c4459f206339a3 Mon Sep 17 00:00:00 2001 From: Tasos Bekos Date: Tue, 24 Dec 2013 23:53:39 +0100 Subject: [PATCH] fix(tabs): use interpolation for type attribute Closes #1409 BREAKING CHANGE: Use interpolation for type attribute. Before: or After: or --- src/tabs/docs/demo.html | 2 +- src/tabs/docs/demo.js | 2 -- src/tabs/tabs.js | 5 +++-- src/tabs/test/tabs.spec.js | 4 ++-- template/tabs/tabset.html | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/tabs/docs/demo.html b/src/tabs/docs/demo.html index d882441739..8f2dc57aca 100644 --- a/src/tabs/docs/demo.html +++ b/src/tabs/docs/demo.html @@ -24,7 +24,7 @@
- + Vertical content 1 Vertical content 2 diff --git a/src/tabs/docs/demo.js b/src/tabs/docs/demo.js index e07b011a7e..6c5e7a4285 100644 --- a/src/tabs/docs/demo.js +++ b/src/tabs/docs/demo.js @@ -9,6 +9,4 @@ var TabsDemoCtrl = function ($scope) { alert('You\'ve selected the alert tab!'); }); }; - - $scope.navType = 'pills'; }; diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index 82994682ea..5881bb8cee 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -82,13 +82,14 @@ angular.module('ui.bootstrap.tabs', []) restrict: 'EA', transclude: true, replace: true, - scope: {}, + scope: { + type: '@' + }, controller: 'TabsetController', templateUrl: 'template/tabs/tabset.html', link: function(scope, element, attrs) { scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false; scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false; - scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs'; } }; }) diff --git a/src/tabs/test/tabs.spec.js b/src/tabs/test/tabs.spec.js index c5eeab0ff6..0e94fb64cb 100644 --- a/src/tabs/test/tabs.spec.js +++ b/src/tabs/test/tabs.spec.js @@ -398,7 +398,7 @@ describe('tabs', function() { beforeEach(inject(function($controller, $rootScope) { scope = $rootScope; //instantiate the controller stand-alone, without the directive - ctrl = $controller('TabsetController', {$scope: scope, $element: null}); + ctrl = $controller('TabsetController', {$scope: scope}); })); @@ -609,7 +609,7 @@ describe('tabs', function() { scope = $rootScope.$new(); scope.navType = 'pills'; - elm = $compile('')(scope); + elm = $compile('')(scope); scope.$apply(); })); diff --git a/template/tabs/tabset.html b/template/tabs/tabset.html index 66a529658c..c050b57570 100644 --- a/template/tabs/tabset.html +++ b/template/tabs/tabset.html @@ -1,6 +1,6 @@
- +