title: Angular 8 number input min/max
body: <p>I have an Angular 8 application. What I wanna do is not letting user to set any other value in number input, than from range of 0-100</p>
  
  <p>I was thinking something like this</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;input type="number" [ngModel]="value" (ngModelChange)="validateValue($event)"&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-js prettyprint-override"><code>value = 100;
  
  validateValue(event: number) {
      if (event &gt; 100) {
        this.value = 100;
      } else if (event &lt; 0) {
        this.value = 0;
      } else {
        this.value = event;
      }
  }
  </code></pre>
  
  <p>When there is a 100 and I delete last digit and write 5 (so now I should have 105), it will do the magic and change the value to 100.</p>
  
  <p>When I cursor select the whole number and write for example 105, it will do the magic too.</p>
  
  <p>However. when I use the step arrows, or cursor select the last digit and change the last digit, the magic isn't happening.</p>
  
  <p>Why is this not working ?</p>