@@ -182,6 +182,7 @@ angular.module('ui.bootstrap.tabs', [])
182
182
templateUrl : 'template/tabs/tab.html' ,
183
183
transclude : true ,
184
184
scope : {
185
+ active : '=?' ,
185
186
heading : '@' ,
186
187
onSelect : '&select' , //This callback is called in contentHeadingTransclude
187
188
//once it inserts the tab's content into the dom
@@ -192,27 +193,7 @@ angular.module('ui.bootstrap.tabs', [])
192
193
} ,
193
194
compile : function ( elm , attrs , transclude ) {
194
195
return function postLink ( scope , elm , attrs , tabsetCtrl ) {
195
- var getActive , setActive ;
196
- if ( attrs . active ) {
197
- getActive = $parse ( attrs . active ) ;
198
- setActive = getActive . assign ;
199
- scope . $parent . $watch ( getActive , function updateActive ( value , oldVal ) {
200
- // Avoid re-initializing scope.active as it is already initialized
201
- // below. (watcher is called async during init with value ===
202
- // oldVal)
203
- if ( value !== oldVal ) {
204
- scope . active = ! ! value ;
205
- }
206
- } ) ;
207
- scope . active = getActive ( scope . $parent ) ;
208
- } else {
209
- setActive = getActive = angular . noop ;
210
- }
211
-
212
196
scope . $watch ( 'active' , function ( active ) {
213
- // Note this watcher also initializes and assigns scope.active to the
214
- // attrs.active expression.
215
- setActive ( scope . $parent , active ) ;
216
197
if ( active ) {
217
198
tabsetCtrl . select ( scope ) ;
218
199
}
@@ -226,7 +207,7 @@ angular.module('ui.bootstrap.tabs', [])
226
207
}
227
208
228
209
scope . select = function ( ) {
229
- if ( ! scope . disabled ) {
210
+ if ( ! scope . disabled ) {
230
211
scope . active = true ;
231
212
}
232
213
} ;
@@ -236,7 +217,6 @@ angular.module('ui.bootstrap.tabs', [])
236
217
tabsetCtrl . removeTab ( scope ) ;
237
218
} ) ;
238
219
239
-
240
220
//We need to transclude later, once the content container is ready.
241
221
//when this link happens, we're inside a tab heading.
242
222
scope . $transcludeFn = transclude ;
0 commit comments