mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-14 09:29:10 +08:00
BREAKING CHANGE
If `bar` is `undefined`, before `<img src="foo/{{bar}}.jpg">` yields
`<img src="foo/.jpg">`. With this change, the binding will not set `src`.
If you want the old behavior, you can do this: `<img src="foo/{{bar || ''}}.jpg">`.
The same applies for `srcset` as well.
Closes #6984
17 lines
401 B
JavaScript
17 lines
401 B
JavaScript
'use strict';
|
|
|
|
describe('ngSrcset', function() {
|
|
var element;
|
|
|
|
afterEach(function() {
|
|
dealoc(element);
|
|
});
|
|
|
|
it('should not result empty string in img srcset', inject(function($rootScope, $compile) {
|
|
$rootScope.image = {};
|
|
element = $compile('<img ng-srcset="{{image.url}} 2x">')($rootScope);
|
|
$rootScope.$digest();
|
|
expect(element.attr('srcset')).toBeUndefined();
|
|
}));
|
|
});
|