File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -201,8 +201,22 @@ angular.module('mm.foundation.tabs', [])
201
201
}
202
202
203
203
scope . $watch ( 'active' , function ( active ) {
204
+ /**
205
+ * The issue https://github.com/pineconellc/angular-foundation/issues/61 was hard to replicate.
206
+ * To replicate it, you need to have a very large page, with lots of data and controllers
207
+ * (I had around 25 controllers who each inherits the same main profile controller )
208
+ * On initialization, attrs.active is true
209
+ * But the active attributes was a complex expression that takes time to parse because of the large amount of controllers on the page
210
+ * The getActive = $parse(attrs.active); expression takes time to parse, but at the same time, the $watch is triggered.
211
+ * This means the setActive is undefined in this specific case.
212
+ *
213
+ */
214
+ if ( typeof setActive !== 'function' ) {
215
+ return ;
216
+ }
217
+
204
218
// Note this watcher also initializes and assigns scope.active to the
205
- // attrs.active expression.
219
+ // attrs.active expression.
206
220
setActive ( scope . $parent , active ) ;
207
221
if ( active ) {
208
222
tabsetCtrl . select ( scope ) ;
You can’t perform that action at this time.
0 commit comments