Is there a way to validate a field in angular without using a directive? For example: I want to make following validation on an input field.
Well you can try to create a func
Value must be an even number
$scope.isEven=function(data) {
if(data) {
return data%2===0
}
return true;
}
The method can either be defined on the current controller scope or on $rootScope.
Not a very angular way, as directives would be better but i think it would work.