I have 2 select boxes, and setting either one should set the second one to 0.
HTML
<select [(ngModel)]="testVar" (ngModelChange)="testFunc($event)">
<option value="0">no</option>
<option value="1">yes</option>
<option value="2">maybe</option>
</select>
<select [(ngModel)]="testVar2" (ngModelChange)="testFunc($event)">
<option value="0">no</option>
<option value="1">yes</option>
<option value="2">maybe</option>
</select>
COMPONENT
testVar = 0;
testVar2 = 1;
testFunc(){
this.testVar2 = 0;
console.log(this.testVar2);
}
This works fine when first hitting the page and changing either box, but after setting the second select back to 1, the two way binding is lost. The console log seems to indicate the model is being updated, but the select box is not responding. What am I missing?