fix(core): make all render3 tests pass in IE9 (#21279)

PR Close #21279
This commit is contained in:
Marc Laval 2018-01-03 14:05:33 +01:00 committed by Kara Erickson
parent a2f3f4550d
commit db55e86e91
2 changed files with 6 additions and 4 deletions

View File

@ -596,8 +596,9 @@ export function elementAttribute(index: number, attrName: string, value: any): v
element.native.removeAttribute(attrName);
} else {
(renderer as ProceduralRenderer3).setAttribute ?
(renderer as ProceduralRenderer3).setAttribute(element.native, attrName, value) :
element.native.setAttribute(attrName, value);
(renderer as ProceduralRenderer3)
.setAttribute(element.native, attrName, stringify(value)) :
element.native.setAttribute(attrName, stringify(value));
}
}
}

View File

@ -104,10 +104,11 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const attValue = attributeMap.get(key);
const lowerCaseKey = key.toLowerCase();
if (typeof attValue !== 'string') {
result += ` ${key}`;
result += ` ${lowerCaseKey}`;
} else {
result += ` ${key}="${attValue}"`;
result += ` ${lowerCaseKey}="${attValue}"`;
}
}
result += '>';