Add below code to following files.
app.component.ts
<input type="text" [(ngModel)]="fname" >
{{fname}}
export class appcomponent {
fname:any;
}
app.module.ts
import {FormsModule} from '@angular/forms';
@NgModule({
imports: [ BrowserModule,FormsModule ],
declarations: [ AppComponent],
bootstrap: [ AppComponent ]
})
Hope this helps