This project was generated with Angular CLI version 9.1.1.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
[(ngModel)]="data"
- app.module.ts
import {FormsModule} from '@angular/forms'; @NgModule({ imports: [ FormsModule ] })
- app.component.html
<input type="text" [(ngModel)]="name">
<p>{{ name }}</p>
for output of this code , check on this link Output