File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1037,7 +1037,7 @@ function $CompileProvider($provide) {
1037
1037
interpolateFn = $interpolate ( attr [ name ] , true ) ;
1038
1038
}
1039
1039
1040
- attr [ name ] = undefined ;
1040
+ attr [ name ] = interpolateFn ( scope ) ;
1041
1041
( $$observers [ name ] || ( $$observers [ name ] = [ ] ) ) . $$inter = true ;
1042
1042
( attr . $$observers && attr . $$observers [ name ] . $$scope || scope ) .
1043
1043
$watch ( interpolateFn , function interpolateFnWatchAction ( value ) {
Original file line number Diff line number Diff line change @@ -1381,9 +1381,10 @@ describe('$compile', function() {
1381
1381
} ) ) ;
1382
1382
1383
1383
1384
- it ( 'should set interpolated attrs to undefined' , inject ( function ( $rootScope , $compile ) {
1384
+ it ( 'should set interpolated attrs to initial interpolation value' , inject ( function ( $rootScope , $compile ) {
1385
+ $rootScope . whatever = 'test value' ;
1385
1386
$compile ( '<div some-attr="{{whatever}}" observer></div>' ) ( $rootScope ) ;
1386
- expect ( directiveAttrs . someAttr ) . toBeUndefined ( ) ;
1387
+ expect ( directiveAttrs . someAttr ) . toBe ( $rootScope . whatever ) ;
1387
1388
} ) ) ;
1388
1389
1389
1390
You can’t perform that action at this time.
0 commit comments