I'm trying to implement simple slider range value control in angular 2 app. On stackoverflow I've found this solution
<input type="range" min="0" max="100" #ranger (input)="getMyValue()">
export class MyComponent implements OnInit {
myValue: number;
constructor() { }
getMyValue() {
this.myValue = 2;
}
ngOnInit() { }
}
this always sets control to default state (which is 50). When I simply use html without binding html renders control properly.
<input type="range" min="0" max="100" #ranger value = 2>
What I'm missing here?