showing results for - "ngmodel vs 28ngmodel 29"
Evie
23 Jul 2016
1[ngModel]="name" is the syntax for one-way binding, while,
2[(ngModel)]="name" is for two-way binding, and the syntax is compound from:
3[ngModel]="name" and (ngModelChange)="name = $event"
4
5//If you only need to pass model, use the first one.
6//If your model needs to listen change events
7//(e.g. when input field value changes),
8//use the second one.