Outputs with output()
Emit events with the new output API.
Signal-Era Outputs
Alongside signal inputs, modern Angular provides the output() function to declare component events, replacing the classic @Output with EventEmitter.
Declaring an Output
Call output() to create an event a component can emit. Provide a generic type for the payload.
import { Component, output } from "@angular/core";
@Component({ selector: "app-counter", template: "" })
export class CounterComponent {
changed = output<number>();
}All lessons in this course
- Signal Inputs with input()
- Required and Transformed Inputs
- Outputs with output()
- View Queries with viewChild