Created
March 29, 2018 16:33
-
-
Save Flayed/ed3bc5bfb65af9770801902ff2542a51 to your computer and use it in GitHub Desktop.
ngModelChange
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select [(ngModel)]="myValue" (ngModelChange)="toNumber()"> | |
<option *ngFor="let s of stuff" [value]="s.value">{{s.key}}</option> | |
</select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public toNumber() { | |
this.myValue = +this.myValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment