764764 priority : 1000 ,
765765 compile : function compile ( element , attrs ) {
766766 // we store the content and remove it before compilation
767- var content = element [ 0 ] . innerHTML ;
767+ var content = element . contents ( ) ;
768768 element . html ( '' ) ;
769769
770770 return function ( $scope , $element , $attr ) {
774774 } , function ( moduleName ) {
775775 if ( angular . isDefined ( moduleName ) ) {
776776 $ocLazyLoad . load ( moduleName ) . then ( function ( ) {
777- $animate . enter ( content , $element ) ;
778- var contents = element . contents ( ) ;
779- angular . forEach ( contents , function ( content ) {
780- if ( content . nodeType !== 3 ) {
781- // 3 is a text node
782- $compile ( content ) ( $scope ) ;
783- }
784- } ) ;
777+ $animate . enter ( $compile ( content ) ( $scope ) , $element ) ;
785778 } ) ;
786779 }
787780 } , true ) ;
12611254} ) ( angular ) ;
12621255// Array.indexOf polyfill for IE8
12631256if ( ! Array . prototype . indexOf ) {
1264- Array . prototype . indexOf = function ( searchElement , fromIndex ) {
1265- var k ;
1257+ Array . prototype . indexOf = function ( searchElement , fromIndex ) {
1258+ var k ;
12661259
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- }
1260+ // 1. Let O be the result of calling ToObject passing
1261+ // the this value as the argument.
1262+ if ( this == null ) {
1263+ throw new TypeError ( '"this" is null or not defined' ) ;
1264+ }
12721265
1273- var O = Object ( this ) ;
1266+ var O = Object ( this ) ;
12741267
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 ;
1268+ // 2. Let lenValue be the result of calling the Get
1269+ // internal method of O with the argument "length".
1270+ // 3. Let len be ToUint32(lenValue).
1271+ var len = O . length >>> 0 ;
12791272
1280- // 4. If len is 0, return -1.
1281- if ( len === 0 ) {
1282- return - 1 ;
1283- }
1273+ // 4. If len is 0, return -1.
1274+ if ( len === 0 ) {
1275+ return - 1 ;
1276+ }
12841277
1285- // 5. If argument fromIndex was passed let n be
1286- // ToInteger(fromIndex); else let n be 0.
1287- var n = + fromIndex || 0 ;
1278+ // 5. If argument fromIndex was passed let n be
1279+ // ToInteger(fromIndex); else let n be 0.
1280+ var n = + fromIndex || 0 ;
12881281
1289- if ( Math . abs ( n ) === Infinity ) {
1290- n = 0 ;
1291- }
1282+ if ( Math . abs ( n ) === Infinity ) {
1283+ n = 0 ;
1284+ }
12921285
1293- // 6. If n >= len, return -1.
1294- if ( n >= len ) {
1295- return - 1 ;
1296- }
1286+ // 6. If n >= len, return -1.
1287+ if ( n >= len ) {
1288+ return - 1 ;
1289+ }
12971290
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- } ;
1291+ // 7. If n >= 0, then Let k be n.
1292+ // 8. Else, n<0, Let k be len - abs(n).
1293+ // If k is less than 0, then let k be 0.
1294+ k = Math . max ( n >= 0 ? n : len - Math . abs ( n ) , 0 ) ;
1295+
1296+ // 9. Repeat, while k < len
1297+ while ( k < len ) {
1298+ // a. Let Pk be ToString(k).
1299+ // This is implicit for LHS operands of the in operator
1300+ // b. Let kPresent be the result of calling the
1301+ // HasProperty internal method of O with argument Pk.
1302+ // This step can be combined with c
1303+ // c. If kPresent is true, then
1304+ // i. Let elementK be the result of calling the Get
1305+ // internal method of O with the argument ToString(k).
1306+ // ii. Let same be the result of applying the
1307+ // Strict Equality Comparison Algorithm to
1308+ // searchElement and elementK.
1309+ // iii. If same is true, return k.
1310+ if ( k in O && O [ k ] === searchElement ) {
1311+ return k ;
1312+ }
1313+ k ++ ;
1314+ }
1315+ return - 1 ;
1316+ } ;
13241317}
0 commit comments