passing parameters on change event in angular 2
try with template reference variable
<select (change)="handle(selectField.value);" #selectField>
Try to use this approach:
HTML TEMPLATE
<select [(ngModel)]="selectedValue" (change)="handle();">
<option [ngValue]="0">Addition</option>
<option [ngValue]="1">Subtraction</option>
<option [ngValue]="2">Multiplication</option>
<option [ngValue]="3">Division</option>
</select>
HomeComponent COMPONENT
import {Component,OnInit} from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
selectedValue: number;
n1 = 0;
n2 = 0;
result = 0;
handle() {
alert("selected option's value is " + this.selectedValue);
}
constructor() {}
ngOnInit() {
}
}
Consider also
<select (change)="handle($event.target.value);">