Thanks to visit codestin.com
Credit goes to github.com

Skip to content

@angular/elements custom element property getter returns a function for signal inputs #62097

Open
@vvolodin

Description

@vvolodin

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

elements

Is this a regression?

No

Description

Angular 19 added support for signal inputs for custom elements, however the getter for the input return a function, which kind of makes sense since it's a signal, but it seems to make the API inconsistent and typings are a pain as well.
Say, in my element I have two inputs:

@Input() oldInput = '';
newInput = input('');

Now in my custom element to access my oldInput's value I can do:

elementRef.oldInput;

but for the new one I have to call it:

elementRef.newInput();

At the same time, both of them allow me to set the value in a same way:

elementRef.oldInput = 'new value';
elementRef.newInput = 'new value';

Which does make sense for oldInput, but not really for a signal input.

This is also not documented at all, and the @angular/elements article in the docs doesn’t even mention signals.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


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


Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentbugcross-cutting: signalsstate: confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions