mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-19 08:00:23 +00:00
chore(sortedHtml): print attributes with empty value
I had to also fix some tests as they started failing on IE8. We should figure out why these extra attributes are set in IE8, but I'm too tired of IE to worry about it now. Since I'm not introducing this issue just making it visible, I'm going to commit this as is.
This commit is contained in:
parent
2007ddd3f8
commit
e281413919
2 changed files with 19 additions and 11 deletions
|
|
@ -741,12 +741,16 @@ describe('$compile', function() {
|
|||
$rootScope.$digest();
|
||||
|
||||
|
||||
expect(sortedHtml(element)).
|
||||
toEqual('<div><b class="i-hello"></b><span class="i-cau">Cau!</span></div>');
|
||||
expect(sortedHtml(element)).toBeOneOf(
|
||||
'<div><b class="i-hello"></b><span class="i-cau">Cau!</span></div>',
|
||||
'<div><b class="i-hello"></b><span class="i-cau" i-cau="">Cau!</span></div>' //ie8
|
||||
);
|
||||
|
||||
$httpBackend.flush();
|
||||
expect(sortedHtml(element)).
|
||||
toEqual('<div><span class="i-hello">Hello!</span><span class="i-cau">Cau!</span></div>');
|
||||
expect(sortedHtml(element)).toBeOneOf(
|
||||
'<div><span class="i-hello">Hello!</span><span class="i-cau">Cau!</span></div>',
|
||||
'<div><span class="i-hello" i-hello="">Hello!</span><span class="i-cau" i-cau="">Cau!</span></div>' //ie8
|
||||
);
|
||||
}
|
||||
));
|
||||
|
||||
|
|
@ -773,8 +777,10 @@ describe('$compile', function() {
|
|||
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(sortedHtml(element)).
|
||||
toEqual('<div><span class="i-hello">Hello, Elvis!</span></div>');
|
||||
expect(sortedHtml(element)).toBeOneOf(
|
||||
'<div><span class="i-hello">Hello, Elvis!</span></div>',
|
||||
'<div><span class="i-hello" i-hello="">Hello, Elvis!</span></div>' //ie8
|
||||
);
|
||||
}
|
||||
));
|
||||
|
||||
|
|
@ -803,8 +809,10 @@ describe('$compile', function() {
|
|||
element = template($rootScope);
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(sortedHtml(element)).
|
||||
toEqual('<div><span class="i-hello">Hello, Elvis!</span></div>');
|
||||
expect(sortedHtml(element)).toBeOneOf(
|
||||
'<div><span class="i-hello">Hello, Elvis!</span></div>',
|
||||
'<div><span class="i-hello" i-hello="">Hello, Elvis!</span></div>' //ie8
|
||||
);
|
||||
}
|
||||
));
|
||||
|
||||
|
|
@ -1490,13 +1498,13 @@ describe('$compile', function() {
|
|||
$rootScope.$digest();
|
||||
expect(sortedHtml(element).replace(' selected="true"', '')).
|
||||
toEqual('<select ng:model="x">' +
|
||||
'<option>Greet !</option>' +
|
||||
'<option value="">Greet !</option>' +
|
||||
'</select>');
|
||||
$rootScope.name = 'Misko';
|
||||
$rootScope.$digest();
|
||||
expect(sortedHtml(element).replace(' selected="true"', '')).
|
||||
toEqual('<select ng:model="x">' +
|
||||
'<option>Greet Misko!</option>' +
|
||||
'<option value="">Greet Misko!</option>' +
|
||||
'</select>');
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ function sortedHtml(element, showNgClass) {
|
|||
|
||||
var attr = attributes[i];
|
||||
if(attr.name.match(/^ng[\:\-]/) ||
|
||||
attr.value &&
|
||||
(attr.value || attr.value == '') &&
|
||||
attr.value !='null' &&
|
||||
attr.value !='auto' &&
|
||||
attr.value !='false' &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue