Skip to content

Support input(), output() and model() in Angular elements #53981

@aihilali

Description

@aihilali

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

lets suppose we have this component :

@Component({standalone: true, ...])
export class ToBeAWebComponent {
   anInput = input<string>();
}

by using the @angular/elements package I can export that component as a web-component named : to-be-a-web-component.

const wc = document.querySelector("to-be-a-web-component");
wc.anInput = "aValue"; // this will create a bug and change the type of anInput from InputSignal to string.
// and if the input value is referenced in the template, or any other place, an error will be raised telling that anInput is not a function 

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI 17.1.0
@angular/core 17.1.0

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions