@@ -1477,7 +1477,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1477
1477
1478
1478
var startSymbol = $interpolate . startSymbol ( ) ,
1479
1479
endSymbol = $interpolate . endSymbol ( ) ,
1480
- denormalizeTemplate = ( startSymbol == '{{' && endSymbol == '}}' )
1480
+ denormalizeTemplate = ( startSymbol === '{{' && endSymbol = == '}}' )
1481
1481
? identity
1482
1482
: function denormalizeTemplate ( template ) {
1483
1483
return template . replace ( / \{ \{ / g, startSymbol ) . replace ( / } } / g, endSymbol ) ;
@@ -1872,7 +1872,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1872
1872
"Unterminated attribute, found '{0}' but no matching '{1}' found." ,
1873
1873
attrStart , attrEnd ) ;
1874
1874
}
1875
- if ( node . nodeType == NODE_TYPE_ELEMENT ) {
1875
+ if ( node . nodeType === NODE_TYPE_ELEMENT ) {
1876
1876
if ( node . hasAttribute ( attrStart ) ) depth ++ ;
1877
1877
if ( node . hasAttribute ( attrEnd ) ) depth -- ;
1878
1878
}
@@ -2058,7 +2058,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2058
2058
nonTlbTranscludeDirective = directive ;
2059
2059
}
2060
2060
2061
- if ( directiveValue == 'element' ) {
2061
+ if ( directiveValue === 'element' ) {
2062
2062
hasElementTranscludeDirective = true ;
2063
2063
terminalPriority = directive . priority ;
2064
2064
$template = $compileNode ;
@@ -2176,7 +2176,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2176
2176
}
2177
2177
compileNode = $template [ 0 ] ;
2178
2178
2179
- if ( $template . length != 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2179
+ if ( $template . length !== 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2180
2180
throw $compileMinErr ( 'tplrt' ,
2181
2181
"Template for directive '{0}' must have exactly one root element. {1}" ,
2182
2182
directiveName , '' ) ;
@@ -2547,7 +2547,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2547
2547
try {
2548
2548
directive = directives [ i ] ;
2549
2549
if ( ( isUndefined ( maxPriority ) || maxPriority > directive . priority ) &&
2550
- directive . restrict . indexOf ( location ) != - 1 ) {
2550
+ directive . restrict . indexOf ( location ) !== - 1 ) {
2551
2551
if ( startAttrName ) {
2552
2552
directive = inherit ( directive , { $$start : startAttrName , $$end : endAttrName } ) ;
2553
2553
}
@@ -2604,7 +2604,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2604
2604
2605
2605
// reapply the old attributes to the new element
2606
2606
forEach ( dst , function ( value , key ) {
2607
- if ( key . charAt ( 0 ) != '$' ) {
2607
+ if ( key . charAt ( 0 ) !== '$' ) {
2608
2608
if ( src [ key ] && src [ key ] !== value ) {
2609
2609
value += ( key === 'style' ? ';' : ' ' ) + src [ key ] ;
2610
2610
}
@@ -2614,16 +2614,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2614
2614
2615
2615
// copy the new attributes on the old attrs object
2616
2616
forEach ( src , function ( value , key ) {
2617
- if ( key == 'class' ) {
2617
+ if ( key === 'class' ) {
2618
2618
safeAddClass ( $element , value ) ;
2619
2619
dst [ 'class' ] = ( dst [ 'class' ] ? dst [ 'class' ] + ' ' : '' ) + value ;
2620
- } else if ( key == 'style' ) {
2620
+ } else if ( key === 'style' ) {
2621
2621
$element . attr ( 'style' , $element . attr ( 'style' ) + ';' + value ) ;
2622
2622
dst [ 'style' ] = ( dst [ 'style' ] ? dst [ 'style' ] + ';' : '' ) + value ;
2623
2623
// `dst` will never contain hasOwnProperty as DOM parser won't let it.
2624
2624
// You will get an "InvalidCharacterError: DOM Exception 5" error if you
2625
2625
// have an attribute like "has-own-property" or "data-has-own-property", etc.
2626
- } else if ( key . charAt ( 0 ) != '$' && ! dst . hasOwnProperty ( key ) ) {
2626
+ } else if ( key . charAt ( 0 ) !== '$' && ! dst . hasOwnProperty ( key ) ) {
2627
2627
dst [ key ] = value ;
2628
2628
dstAttr [ key ] = srcAttr [ key ] ;
2629
2629
}
@@ -2662,7 +2662,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2662
2662
}
2663
2663
compileNode = $template [ 0 ] ;
2664
2664
2665
- if ( $template . length != 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2665
+ if ( $template . length !== 1 || compileNode . nodeType !== NODE_TYPE_ELEMENT ) {
2666
2666
throw $compileMinErr ( 'tplrt' ,
2667
2667
"Template for directive '{0}' must have exactly one root element. {1}" ,
2668
2668
origAsyncDirective . name , templateUrl ) ;
@@ -2690,7 +2690,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2690
2690
childTranscludeFn , $compileNode , origAsyncDirective , preLinkFns , postLinkFns ,
2691
2691
previousCompileContext ) ;
2692
2692
forEach ( $rootElement , function ( node , i ) {
2693
- if ( node == compileNode ) {
2693
+ if ( node === compileNode ) {
2694
2694
$rootElement [ i ] = $compileNode [ 0 ] ;
2695
2695
}
2696
2696
} ) ;
@@ -2815,15 +2815,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2815
2815
2816
2816
2817
2817
function getTrustedContext ( node , attrNormalizedName ) {
2818
- if ( attrNormalizedName == "srcdoc" ) {
2818
+ if ( attrNormalizedName === "srcdoc" ) {
2819
2819
return $sce . HTML ;
2820
2820
}
2821
2821
var tag = nodeName_ ( node ) ;
2822
2822
// maction[xlink:href] can source SVG. It's not limited to <maction>.
2823
- if ( attrNormalizedName == "xlinkHref" ||
2824
- ( tag == "form" && attrNormalizedName == "action" ) ||
2825
- ( tag != "img" && ( attrNormalizedName == "src" ||
2826
- attrNormalizedName == "ngSrc" ) ) ) {
2823
+ if ( attrNormalizedName === "xlinkHref" ||
2824
+ ( tag === "form" && attrNormalizedName = == "action" ) ||
2825
+ ( tag !== "img" && ( attrNormalizedName = == "src" ||
2826
+ attrNormalizedName === "ngSrc" ) ) ) {
2827
2827
return $sce . RESOURCE_URL ;
2828
2828
}
2829
2829
}
@@ -2886,7 +2886,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2886
2886
//skip animations when the first digest occurs (when
2887
2887
//both the new and the old values are the same) since
2888
2888
//the CSS classes are the non-interpolated values
2889
- if ( name === 'class' && newValue != oldValue ) {
2889
+ if ( name === 'class' && newValue !== oldValue ) {
2890
2890
attr . $updateClass ( newValue , oldValue ) ;
2891
2891
} else {
2892
2892
attr . $set ( name , newValue ) ;
@@ -2917,7 +2917,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2917
2917
2918
2918
if ( $rootElement ) {
2919
2919
for ( i = 0 , ii = $rootElement . length ; i < ii ; i ++ ) {
2920
- if ( $rootElement [ i ] == firstElementToRemove ) {
2920
+ if ( $rootElement [ i ] === firstElementToRemove ) {
2921
2921
$rootElement [ i ++ ] = newNode ;
2922
2922
for ( var j = i , j2 = j + removeCount - 1 ,
2923
2923
jj = $rootElement . length ;
@@ -3188,7 +3188,7 @@ function tokenDifference(str1, str2) {
3188
3188
for ( var i = 0 ; i < tokens1 . length ; i ++ ) {
3189
3189
var token = tokens1 [ i ] ;
3190
3190
for ( var j = 0 ; j < tokens2 . length ; j ++ ) {
3191
- if ( token == tokens2 [ j ] ) continue outer;
3191
+ if ( token === tokens2 [ j ] ) continue outer;
3192
3192
}
3193
3193
values += ( values . length > 0 ? ' ' : '' ) + token ;
3194
3194
}
0 commit comments