Angular · Junior · Question 66 of 75

How do you emit a value from a component declared with output()?

saved = output<User>();

save() {
  this.saved.emit(this.user());
}

Explanation

The parent listens with (saved)="onSaved($event)", where $event is the emitted value.

Further reading

Problem with a question

Angular · Junior · question 66

Test yourself

Take the Angular · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz