@@ -30,7 +30,7 @@ function TabsetCtrl($scope, $element) {
3030
3131 ctrl . addTab = function addTab ( tab ) {
3232 tabs . push ( tab ) ;
33- if ( tabs . length == 1 ) {
33+ if ( tabs . length == 1 || tab . active ) {
3434 ctrl . select ( tab ) ;
3535 }
3636 } ;
@@ -186,16 +186,11 @@ function($parse, $http, $templateCache, $compile) {
186186 compile : function ( elm , attrs , transclude ) {
187187 return function postLink ( scope , elm , attrs , tabsetCtrl ) {
188188 var getActive , setActive ;
189- scope . active = false ; // default value
190189 if ( attrs . active ) {
191190 getActive = $parse ( attrs . active ) ;
192191 setActive = getActive . assign ;
193192 scope . $parent . $watch ( getActive , function updateActive ( value ) {
194- if ( ! ! value && scope . disabled ) {
195- setActive ( scope . $parent , false ) ; // Prevent active assignment
196- } else {
197- scope . active = ! ! value ;
198- }
193+ scope . active = ! ! value ;
199194 } ) ;
200195 } else {
201196 setActive = getActive = angular . noop ;
@@ -226,13 +221,11 @@ function($parse, $http, $templateCache, $compile) {
226221 scope . $on ( '$destroy' , function ( ) {
227222 tabsetCtrl . removeTab ( scope ) ;
228223 } ) ;
229- //If the tabset sets this tab to active, set the parent scope's active
230- //binding too. We do this so the watch for the parent's initial active
231- //value won't overwrite what is initially set by the tabset
232224 if ( scope . active ) {
233225 setActive ( scope . $parent , true ) ;
234226 }
235227
228+
236229 //We need to transclude later, once the content container is ready.
237230 //when this link happens, we're inside a tab heading.
238231 scope . $transcludeFn = transclude ;
0 commit comments