我尝试执行以下操作
if ($scope.RetypePassword != $scope.resource.Password) {
$scope.resource.Password.$setValidity("missmatch", false);
} else {
$scope.resource.Password.$setValidity("missmatch", true);
}
但因此错误而失败
TypeError: Object doesn't support property or method '$setValidity'
可能是什么原因?
resource.Password 数据绑定到这样的输入
<input type="password" ng-model="resource.Password" name="Password" />