mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(compiler): Backwards compatibility with TDB for host attributes (#51498)
TemplateDefinitionBuilder only extracts host attributes if they are text attributes. For example, `[attr.foo]="'my-value'"` is not extracted despite being a string literal, because it is not a text attribute. PR Close #51498
This commit is contained in:
committed by
Jessica Janiuk
parent
8f90630dc8
commit
d0b83b14be
+1
-2
@@ -183,8 +183,7 @@
|
||||
"chain_attribute_bindings_mixed.js"
|
||||
]
|
||||
}
|
||||
],
|
||||
"skipForTemplatePipeline": true
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "should chain multiple host listeners into a single instruction",
|
||||
|
||||
@@ -87,6 +87,11 @@ function extractAttributeOp(
|
||||
// string literal, because it is not a text attribute.
|
||||
extractable &&= op.isTextAttribute;
|
||||
}
|
||||
if (unit.job instanceof HostBindingCompilationJob) {
|
||||
// TemplateDefinitionBuilder also does not seem to extract string literals if they are part of
|
||||
// a host attribute.
|
||||
extractable &&= op.isTextAttribute;
|
||||
}
|
||||
}
|
||||
|
||||
if (extractable) {
|
||||
|
||||
Reference in New Issue
Block a user