Skip to content

Type checking signal call in templates #49657

@edbzn

Description

@edbzn

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.

@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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions