Difference between [(ngModel)] and [ngModel] for binding state to property?

[(ngModel)]="overRideRate" is the short form of [ngModel]="overRideRate"
(ngModelChange)="overRideRate = $event"

  • [ngModel]="overRideRate" is to bind overRideRate to the input.value
  • (ngModelChange)="overRideRate = $event" is to update overRideRate with the value of input.value when the change event was emitted.

Together they are what Angular2 provides for two-way binding.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)