@@ -2273,7 +2273,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2273
2273
2274
2274
2275
2275
function addAttrInterpolateDirective ( node , directives , value , name , allOrNothing ) {
2276
- var interpolateFn = $interpolate ( value , true ) ;
2276
+ var trustedContext = getTrustedContext ( node , name ) ;
2277
+ allOrNothing = ALL_OR_NOTHING_ATTRS [ name ] || allOrNothing ;
2278
+
2279
+ var interpolateFn = $interpolate ( value , true , trustedContext , allOrNothing ) ;
2277
2280
2278
2281
// no interpolation found -> ignore
2279
2282
if ( ! interpolateFn ) return ;
@@ -2298,19 +2301,21 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
2298
2301
pre : function attrInterpolatePreLinkFn ( scope , element , attr ) {
2299
2302
var $$observers = ( attr . $$observers || ( attr . $$observers = { } ) ) ;
2300
2303
2301
- // If the attribute was removed, then we are done
2302
- if ( ! attr [ name ] ) {
2303
- return ;
2304
- }
2304
+ // If the attribute has changed since compilation
2305
+ if ( attr [ name ] !== value ) {
2306
+ // If the attribute was removed, then we are done
2307
+ if ( ! attr [ name ] ) {
2308
+ return ;
2309
+ }
2305
2310
2306
- // we need to interpolate again, in case the attribute value has been updated
2307
- // (e.g. by another directive's compile function)
2308
- interpolateFn = $interpolate ( attr [ name ] , true , getTrustedContext ( node , name ) ,
2309
- ALL_OR_NOTHING_ATTRS [ name ] || allOrNothing ) ;
2311
+ // we need to interpolate again, in case the attribute value has been updated
2312
+ // (e.g. by another directive's compile function)
2313
+ interpolateFn = $interpolate ( value = attr [ name ] , true , trustedContext , allOrNothing ) ;
2310
2314
2311
- // if attribute was updated so that there is no interpolation going on we don't want to
2312
- // register any observers
2313
- if ( ! interpolateFn ) return ;
2315
+ // if attribute was updated so that there is no interpolation going on we don't want to
2316
+ // register any observers
2317
+ if ( ! interpolateFn ) return ;
2318
+ }
2314
2319
2315
2320
// initialize attr object so that it's ready in case we need the value for isolate
2316
2321
// scope initialization, otherwise the value would not be available from isolate
0 commit comments