Angular · Junior · Question 13 of 75
What is the "banana in a box" syntax [(ngModel)]="name"?
- ✓Correct answer: Two-way binding: property binding plus an event binding that writes the new value back
- 2A binding that runs only once on component creation
- 3A way to bind a CSS class
Explanation
[(x)] is sugar for [x]="value" (xChange)="value = $event". ngModel comes from FormsModule, which must be added to the component's imports.