Complete the code to bind the input value to the component property using two-way binding.
<input type="text" [(ngModel)]="[1]">
The [(ngModel)] directive binds the input value to the username property in the component, enabling two-way binding.
Complete the code to import the module needed for two-way binding in Angular forms.
import { [1] } from '@angular/forms';
The FormsModule must be imported to use [(ngModel)] for two-way binding in template-driven forms.
Fix the error in the component template to correctly bind the input value two-way.
<input type="text" [1]>
Two-way binding requires the syntax [(ngModel)]="propertyName". Using only [ngModel] is one-way binding.
Fill both blanks to complete the component decorator for enabling two-way binding.
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
imports: [[1]],
standalone: [2]
})To use two-way binding in a standalone component, import FormsModule and set standalone to true.
Fill all three blanks to create a two-way bound input with a label and bind it to the 'email' property.
<label for="emailInput">Email:</label> <input id="emailInput" type="email" [1]="email" [2] [3]>
The input needs a name attribute for forms, [(ngModel)]="email" for two-way binding, and required for validation.