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)"/>

valueChange(value){

}

Party on!





Comments

Popular posts from this blog

A quick tutorial for OWASP ZAP tool for beginners

ionic2 cordova build android - Unable resolve gradle 2.2.3