Angular 2 ngModelChange select option, grab a specific property

<select class="form-control" [ngModel]="selectedWorkout" (ngModelChange)="onChange($event)">
    <option *ngFor="#workout of workouts" [value]="workout.id">{{workout.name}}</option>
</select>

OR

<select class="form-control" [(ngModel)]="selectedWorkout" (change)="onChange($event.target.value)">
    <option *ngFor="#workout of workouts" [value]="workout.id" >{{workout.name}}</option>
</select>

check this

Leave a Comment

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