You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are relevant/related to the feature request?
compiler, core
Description
A common mistake when using signals in templates, is to forget about calling the signal to get its value.
We already have protection against this in template interpolations. But we need the same kind of protection in regular bindings, for example:
[attr.data-e2e]="mySignal"
or
<my-component [someInput]="'someString' + mySignal">I forgot to add parentheses</my-component>
Proposed solution
I'm not very familiar with Angular internals but this seems like something that could be an "Extended diagnostic", like the template interpolation one?
Alternatives considered
Lint rules? I don't really know what would make sense.
The text was updated successfully, but these errors were encountered:
Hi, this has been discussed when implementing the extended diagnostic for non-invoked signals.
There are legitimate cases where signals are not invoked (for example when there is an underlying model()).
Please have a look at #49657
Ok, understood! Maybe linting can be of help, eventually. I think my company, as an organization, currently would prefer to be warned about this, until we frequently start using Signals objects without calling them. We currently don't.
Which @angular/* package(s) are relevant/related to the feature request?
compiler, core
Description
A common mistake when using signals in templates, is to forget about calling the signal to get its value.
We already have protection against this in template interpolations. But we need the same kind of protection in regular bindings, for example:
or
Proposed solution
I'm not very familiar with Angular internals but this seems like something that could be an "Extended diagnostic", like the template interpolation one?
Alternatives considered
Lint rules? I don't really know what would make sense.
The text was updated successfully, but these errors were encountered: