I have a form and want to test the validity of the form. I have a function in the controller that checks for $valid
$scope.checkValid = function(){
console.log($scope.form.address)
console.log($scope.form.address.$valid);
if($scope.form.address.$valid){
dosomething();
}
}
The dosomething() does nothing!! The first console.log produces a Constructor object with the valid as true.
$valid: true
yet the second console log displays FALSE!
Why would this happen? I cant figure it out and google has no answers.
Any advice appreciated.