Angular 22 · Components and templates
Pass data in and out
Receive a value with input() and notify the parent with output().
name = input.required<string>();
selected = output<string>();
select() {
this.selected.emit(this.name());
}
Official Angular 22 documentation
More components and templates commands
- Write a standalone component
- Show content conditionally
- Loop over items
- Handle an event
- Bind a property
- Toggle a CSS class
All components and templates commands · Angular 22 cheatsheet