In this video we are going to learn about Two Way Binding.
Two-way data binding in Angular will help users to exchange data from the component to view and from view to the component.
It will help users to establish communication bi-directionally.
Two-way data binding can be achieved using a ngModel directive in Angular.
So lets see how can we do two way binding in angular 10.
Switch to the project and just open app.component.html file.
Here lets create a propery and input text field.


msg= '';
<input type=\"text\" [(ngModel)] = 'msg' />


Now for ngModel we have to import FormsModule.
So go to the app.module.ts file and here first of all import form Module.


import { FormsModule } from \"@angular/forms\";


Now add this FormsModule to the Imports array.

@NgModule({
imports: [BrowserModule, FormsModule],
declarations: [ AppComponent],
bootstrap: [AppComponent]
});

Now go to the app.component.html and here just print the msg.

<h1>{{msg}}</h1>

Now lets check it.
So switch to the browser and inside the text input field add any text.
And here you can see the text.
So in this way can do two way binding in angular 10.