Angular · Junior · Question 13 of 75

What is the "banana in a box" syntax [(ngModel)]="name"?

Explanation

[(x)] is sugar for [x]="value" (xChange)="value = $event". ngModel comes from FormsModule, which must be added to the component's imports.

Further reading

Problem with a question

Angular · Junior · question 13

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