776
776
} , function ( moduleName ) {
777
777
if ( angular . isDefined ( moduleName ) ) {
778
778
$ocLazyLoad . load ( moduleName ) . then ( function ( ) {
779
- $animate . enter ( $compile ( content ) ( $scope ) , $element ) ;
779
+ // Attach element contents to DOM and then compile them.
780
+ // This prevents an issue where IE invalidates saved element objects (HTMLCollections)
781
+ // of the compiled contents when attaching to the parent DOM.
782
+ var contentElement = angular . element ( content ) ;
783
+ $animate . enter ( contentElement , $element ) ;
784
+ $compile ( contentElement ) ( $scope ) ;
780
785
} ) ;
781
786
}
782
787
} , true ) ;
1256
1261
} ) ( angular ) ;
1257
1262
// Array.indexOf polyfill for IE8
1258
1263
if ( ! Array . prototype . indexOf ) {
1259
- Array . prototype . indexOf = function ( searchElement , fromIndex ) {
1260
- var k ;
1264
+ Array . prototype . indexOf = function ( searchElement , fromIndex ) {
1265
+ var k ;
1261
1266
1262
- // 1. Let O be the result of calling ToObject passing
1263
- // the this value as the argument.
1264
- if ( this == null ) {
1265
- throw new TypeError ( '"this" is null or not defined' ) ;
1266
- }
1267
+ // 1. Let O be the result of calling ToObject passing
1268
+ // the this value as the argument.
1269
+ if ( this == null ) {
1270
+ throw new TypeError ( '"this" is null or not defined' ) ;
1271
+ }
1267
1272
1268
- var O = Object ( this ) ;
1273
+ var O = Object ( this ) ;
1269
1274
1270
- // 2. Let lenValue be the result of calling the Get
1271
- // internal method of O with the argument "length".
1272
- // 3. Let len be ToUint32(lenValue).
1273
- var len = O . length >>> 0 ;
1275
+ // 2. Let lenValue be the result of calling the Get
1276
+ // internal method of O with the argument "length".
1277
+ // 3. Let len be ToUint32(lenValue).
1278
+ var len = O . length >>> 0 ;
1274
1279
1275
- // 4. If len is 0, return -1.
1276
- if ( len === 0 ) {
1277
- return - 1 ;
1278
- }
1280
+ // 4. If len is 0, return -1.
1281
+ if ( len === 0 ) {
1282
+ return - 1 ;
1283
+ }
1279
1284
1280
- // 5. If argument fromIndex was passed let n be
1281
- // ToInteger(fromIndex); else let n be 0.
1282
- var n = + fromIndex || 0 ;
1285
+ // 5. If argument fromIndex was passed let n be
1286
+ // ToInteger(fromIndex); else let n be 0.
1287
+ var n = + fromIndex || 0 ;
1283
1288
1284
- if ( Math . abs ( n ) === Infinity ) {
1285
- n = 0 ;
1286
- }
1289
+ if ( Math . abs ( n ) === Infinity ) {
1290
+ n = 0 ;
1291
+ }
1287
1292
1288
- // 6. If n >= len, return -1.
1289
- if ( n >= len ) {
1290
- return - 1 ;
1291
- }
1293
+ // 6. If n >= len, return -1.
1294
+ if ( n >= len ) {
1295
+ return - 1 ;
1296
+ }
1292
1297
1293
- // 7. If n >= 0, then Let k be n.
1294
- // 8. Else, n<0, Let k be len - abs(n).
1295
- // If k is less than 0, then let k be 0.
1296
- k = Math . max ( n >= 0 ? n : len - Math . abs ( n ) , 0 ) ;
1297
-
1298
- // 9. Repeat, while k < len
1299
- while ( k < len ) {
1300
- // a. Let Pk be ToString(k).
1301
- // This is implicit for LHS operands of the in operator
1302
- // b. Let kPresent be the result of calling the
1303
- // HasProperty internal method of O with argument Pk.
1304
- // This step can be combined with c
1305
- // c. If kPresent is true, then
1306
- // i. Let elementK be the result of calling the Get
1307
- // internal method of O with the argument ToString(k).
1308
- // ii. Let same be the result of applying the
1309
- // Strict Equality Comparison Algorithm to
1310
- // searchElement and elementK.
1311
- // iii. If same is true, return k.
1312
- if ( k in O && O [ k ] === searchElement ) {
1313
- return k ;
1314
- }
1315
- k ++ ;
1316
- }
1317
- return - 1 ;
1318
- } ;
1298
+ // 7. If n >= 0, then Let k be n.
1299
+ // 8. Else, n<0, Let k be len - abs(n).
1300
+ // If k is less than 0, then let k be 0.
1301
+ k = Math . max ( n >= 0 ? n : len - Math . abs ( n ) , 0 ) ;
1302
+
1303
+ // 9. Repeat, while k < len
1304
+ while ( k < len ) {
1305
+ // a. Let Pk be ToString(k).
1306
+ // This is implicit for LHS operands of the in operator
1307
+ // b. Let kPresent be the result of calling the
1308
+ // HasProperty internal method of O with argument Pk.
1309
+ // This step can be combined with c
1310
+ // c. If kPresent is true, then
1311
+ // i. Let elementK be the result of calling the Get
1312
+ // internal method of O with the argument ToString(k).
1313
+ // ii. Let same be the result of applying the
1314
+ // Strict Equality Comparison Algorithm to
1315
+ // searchElement and elementK.
1316
+ // iii. If same is true, return k.
1317
+ if ( k in O && O [ k ] === searchElement ) {
1318
+ return k ;
1319
+ }
1320
+ k ++ ;
1321
+ }
1322
+ return - 1 ;
1323
+ } ;
1319
1324
}
0 commit comments