fix(ivy): error for empty bindings on ng-template (#30829)
Fixes Ivy throwing an error if it runs into an empty property binding on an `ng-template` (e.g. `<ng-template [something]=""></ng-template>`) by not generating an update instruction for it. Fixes #30801. This PR resoves FW-1356. PR Close #30829
This commit is contained in:
@ -1024,10 +1024,13 @@ export class TemplateDefinitionBuilder implements t.Visitor<void>, LocalResolver
|
||||
attrs.forEach(input => {
|
||||
if (input instanceof t.BoundAttribute) {
|
||||
const value = input.value.visit(this._valueConverter);
|
||||
this.allocateBindingSlots(value);
|
||||
this.updateInstruction(
|
||||
templateIndex, template.sourceSpan, R3.property,
|
||||
() => [o.literal(input.name), this.convertPropertyBinding(context, value, true)]);
|
||||
|
||||
if (value !== undefined) {
|
||||
this.allocateBindingSlots(value);
|
||||
this.updateInstruction(
|
||||
templateIndex, template.sourceSpan, R3.property,
|
||||
() => [o.literal(input.name), this.convertPropertyBinding(context, value, true)]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user