Complete the code to bind the input value to the component property.
<input type="text" [(ngModel)]="[1]">
The [(ngModel)] directive binds the input field to the userName property in the component, enabling two-way data binding.
Complete the code to display the bound property value in the template.
<p>Hello, {{ [1] }}!</p>The interpolation syntax {{ userName }} displays the current value of the userName property from the component.
Fix the error in the code to correctly bind the input and display the value.
<input type="text" [ngModel]="[1]"> <p>{{ userName }}</p>
Using [ngModel] alone creates one-way binding from the component to the input. To enable two-way binding, use [(ngModel)] instead. Here, the property is userName.
Fill both blanks to create a two-way data binding and display the updated value.
<input type="text" [1]="userName"> <p>{{ [2] }}</p>
The [(ngModel)] directive binds the input to the userName property, and interpolation displays its current value.
Fill all three blanks to bind the input, update the property, and display the value.
<input type="text" [1]="[2]"> <p>{{ [3] }}</p>
Use [(ngModel)] for two-way binding on the input with the userName property, and display it with interpolation.