I have some simply validation in my range inputs like this:
<form name="form" novalidate>
Min: <input type="number" name="min" ng-model="rangemin" ng-pattern="/^[0-9]+$/">
Max: <input type="number" name="max" ng-model="rangemax" ng-pattern="/^[0-9]+$/">
</form>
I added the classes ng-valid(green) and ng-invalid(red) in my CSS so that it gets painted correctly and the input gets saved in ng-model variable. And that works fine, but I want to put on some extra validation. If min is greater then max or max is lower than min then the input shouldn't be valid.
How can i achieve this?
I'm new to Angular, I can make directives, controllers etc. but I dont know how to validate both inputs and set the invalid state on them.