I have a number which is bound to localValue. I would, when I hit maximum value on set(localValue) or on blur, update value for upper max value (in sample is 50).
But it seem it work only once after set or blur didn't work anymore (blur never work).
@Component({
selector: 'my-app',
providers: [],
template: `
<div>
<h2>Test On blur update with valid value (Value max is 50)</h2>
<h2>If you type 9999 --> 5099</h2>
<input type="number" [(ngModel)]="localValue" (blur)="OnLostFocus()"/>
</div>
`
})
...
private localValue: number;
public set localValue(value: number) {
if(value > 50){
value = 50;
}
this._localValue = value;
}