CodeZettaInterview Hub

Angular · Components · Fresh / Intern · Scenario

Explain @Input and @Output on Angular components.

Short Interview Answer

@Input receives data from the parent; @Output emits events via EventEmitter (or output() function).

Detailed Explanation

Inputs are one-way down; outputs notify parents of events. Prefer the signal-based input()/output() APIs in modern Angular. Avoid two-way binding unless needed; use model() for two-way signal inputs.

Example

readonly name = input.required<string>();
readonly saved = output<void>();

Did you know this answer?