Skip to content

Events break the tree of element injectors #577

@vsavkin

Description

@vsavkin

Try this:

<div [some-component]>
   <span><button (click)="someAction()">Submit</button></span>
</div>

Both the div and the button will point to the same proto element injector. This is not correct. Angular will throw trying to hydrate this view.

An easy way to fix it is to change ProtoElementInjectorBuilder and add || isPresent(current.eventBindings)) to if (injectorBindings.length > 0 || isPresent(current.variableBindings). I am not sure if it is a good fix though.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions