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:
Dylan Hunn
2023-08-24 22:06:51 -07:00
committed by Jessica Janiuk
parent 8f90630dc8
commit d0b83b14be
2 changed files with 6 additions and 2 deletions
@@ -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) {