output()

noun

say it: “OWT-put” /ˈaʊtpʊt/

An event a child component sends up to its parent, declared with output().

What does output() do?

output() declares an event a component can send up to its parent, such as "this item was deleted".

export class TodoItem {
  deleted = output<number>();
  remove() { this.deleted.emit(this.id); }
}

// parent template: <app-todo-item (deleted)="onDeleted($event)" />

In a sentence

  • “The card's added = output<Product>() tells the page which product was added.”

Level: Apprentice · More Angular terms at this level

Updated