Signal Inputs with input()
Declare reactive inputs as signals.
Signal-Based Inputs
Modern Angular provides the input() function to declare component inputs as signals, replacing the classic @Input decorator with a reactive alternative.
Declaring a Signal Input
Call input() with an optional default value. The result is a read-only signal.
import { Component, input } from "@angular/core";
@Component({ selector: "app-greet", template: "" })
export class GreetComponent {
name = input("World");
}All lessons in this course
- Signal Inputs with input()
- Required and Transformed Inputs
- Outputs with output()
- View Queries with viewChild