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:
@ -566,6 +566,16 @@ class ArrayConsole implements Console {
|
||||
]);
|
||||
});
|
||||
|
||||
it('should parse mixed case bound attributes with dot in the attribute name', () => {
|
||||
expect(humanizeTplAst(parse('<div [attr.someAttr.someAttrSuffix]="v">', []))).toEqual([
|
||||
[ElementAst, 'div'],
|
||||
[
|
||||
BoundElementPropertyAst, PropertyBindingType.Attribute, 'someAttr.someAttrSuffix',
|
||||
'v', null
|
||||
]
|
||||
]);
|
||||
});
|
||||
|
||||
it('should parse and dash case bound classes', () => {
|
||||
expect(humanizeTplAst(parse('<div [class.some-class]="v">', []))).toEqual([
|
||||
[ElementAst, 'div'],
|
||||
|
Reference in New Issue
Block a user