Web
Analytics
angular 4 data binding | example - Tutorial

For Consultation : +91 9887575540

Stay Connected :

Angular 4 Two Way Data Binding

  • Two-way data binding uses the ngModel directive, which is included in FormsModule.
  • Bidirectional data flow(1. From form control to component property. 2 From Component property to Form Control)
  • Two-way data binding is represented by [(ngModel)]
  • It is binding on event and property together.

Example : 

Step 1 : Create new Component.

ng g c bindingtwoway –flat –is –it

Step2: Write Following code in bindingtwoway.component.ts

Step 3: Add selector of newly created component into app.component.html

Step 4: Run using ng serve –open

Output:

Select your currency