[(ngModel)]

To use two-way binding in angular, we can use this simple example. x= Whatever Component

  1. app.module.ts
    import { FormsModule } from '@angular/forms';
    ADD FormsModule in imports:
  2. x.component.ts
    Add superHero"superman"; after  export class HeroesComponent implements OnInit {
  3. x.component.html ADD THE FOLLOWING HTML:
    <h2>{{superHero| uppercase}} Details</h2>
    <input [(ngModel)]="superHero" placeholder="name"/>

Its that simple, enjoy