In my angular 4 project I have multiple forms, some of these forms have an input field that needs to be controlled, and if the value isn't correct the button save needs to be disabled.
If i want a input field with only positive numbers I use this:
<input type="number" class="form-control" id="blockFrom" required
[(ngModel)]="blockFrom" min="0" name="blockFrom">
<button (click)="save()" [disabled]="modelForm.form.invalid ||
modelForm.form.pristine">save</button>
But if I write in the input field negative numbers the button is enabled (I see the input field red correctly because the value isn't permitted) Why? How can I block the button if value is negative?