Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 0687a4f

Browse files
fixup! fix(interpolate): do not create directives for constant media URL attributes
1 parent 9688941 commit 0687a4f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/ng/directive/ngSrcSpec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ describe('ngSrc', function() {
7878
expect(element.prop('src')).toEqual('http://somewhere/abc');
7979
}));
8080
}
81+
82+
it('should work with `src` attribute on the same element', inject(function($rootScope, $compile) {
83+
$rootScope.imageUrl = 'dynamic';
84+
element = $compile('<img ng-src="{{imageUrl}}" src="static">')($rootScope);
85+
expect(element.attr('src')).toBe('static');
86+
$rootScope.$digest();
87+
expect(element.attr('src')).toBe('dynamic');
88+
dealoc(element);
89+
90+
element = $compile('<img src="static" ng-src="{{imageUrl}}">')($rootScope);
91+
expect(element.attr('src')).toBe('static');
92+
$rootScope.$digest();
93+
expect(element.attr('src')).toBe('dynamic');
94+
}));
8195
});
8296

8397
describe('iframe[ng-src]', function() {

0 commit comments

Comments
 (0)