fix(compiler): correctly parse attributes with a dot in the name (#32256)

Previously the compiler would ignore everything in the attribute
name after the first dot. For example
<div [attr.someAttr.attrSuffix]="var"></div>
is turned into <div someAttr="varValue"></div>.

This commit ensures that whole attribute name is captured.
Now <div [attr.someAttr.attrSuffix]="var"></div>
is turned into <div someAttr.attrSuffix="varValue"></div>

PR Close #32256
This commit is contained in:
Sergey Nikitin
2019-08-22 09:45:43 +07:00
committed by atscott
parent 55b1b7745b
commit 687582fd99
2 changed files with 11 additions and 1 deletions

View File

@ -278,7 +278,7 @@ export class BindingParser {
// Check for special cases (prefix style, attr, class)
if (parts.length > 1) {
if (parts[0] == ATTRIBUTE_PREFIX) {
boundPropertyName = parts[1];
boundPropertyName = parts.slice(1).join(PROPERTY_PARTS_SEPARATOR);
if (!skipValidation) {
this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true);
}