### Which @angular/* package(s) are relevant/related to the feature request? core ### Description Let's say I omit to call a signal in the template, as we are used to with regular values. ```ts @Component({ template: `{{ value }}`, }) export class AppComponent { value = signal('Hello World!') } ``` No compilation error to prevent this error, resulting in an undesired string rendered to the screen: `function () { [native code] }`. ### Proposed solution Strict type-checking of signal calls in the template would improve DX, especially for newcomers. ### Alternatives considered No type checking.
Activity
eneajaho commentedon Mar 31, 2023
Hi,
This would be more appropriate as a template diagnostic rather than typecheck error.
What about cases like:
Should this throw an error? Probably not.
So, this would make sense only in interpolation imo.
JeanMeche commentedon Mar 31, 2023
I drafted a PR for this. If the team is ready to include this diagnostic, I can finish working on it 👍
eneajaho commentedon Mar 31, 2023
I was thinking what about this:
{{ mySignal | myPipeThatAcceptsSignal }}How that would behave?
JeanMeche commentedon Mar 31, 2023
That's already handled by the typing. For example with a
Signal<number>and unPipe.transform(number)you'll get :Argument of type 'WritableSignal<number>' is not assignable to parameter of type 'number'.pkozlowski-opensource commentedon Oct 11, 2023
With #49660 merged I think that we are in a much better state. Going to close it for now, will see if people bump into other common cases.
angular-automatic-lock-bot commentedon Nov 11, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.