Angular2 - data bindings concepts

Important import :

import {FormsModule} from '@angular/forms'
And include this into your app module 

imports :[ ... , FormsModule ]

Two way data binding (banana box syntax)

<input id="name" type="text" [(ngModel)]="name" />

Or your can do it the longer way :

<input id="name" type="text" [ngModel]="name" (ngModelChange)="valueChange($event)"/>



Party on!


Popular posts from this blog

Solving Sonarqube :- Project was never analyzed. A regular analysis is required before a branch analysis

spark - pyspark reading from excel files