What I want is an input, number only, which have a red border when you type anything but a number to it.
What I did is
<input ng-model="number" name="number" type="number" step="any" />
and this
.ng-dirty.ng-invalid {
border: 1px solid red;
}
now if you type in "blah blah", it's gonna be $valid == false
BUT it's not gonna have a red border, because typing in "blah blah" won't update the model thus won't put ng-dirty class to the input. I obviously don't want the input to be red bordered right away, how do I deal with this?
You can test it here http://plnkr.co/edit/HWGKkzmxVx0GYIiRGyqX?p=preview
Thanks.
PS: I'm on chrome, using 1.1.5
// edit
when I remove the required
it's even gonna be valid http://plnkr.co/edit/E763TRUnYr47xwGqJOkG?p=preview apparently