Angular · Middle · Question 11 of 75

What does model() create?

export class Rating {
  value = model(0);
  set(v: number) { this.value.set(v); }
}
// parent: <app-rating [(value)]="rating" />

Explanation

Writing to a model signal emits a valueChange event, so [(value)] keeps the parent in sync. The parent can bind a plain field or a writable signal.

Further reading

Problem with a question

Angular · Middle · question 11

Test yourself

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

Take this quiz