Hello, is there a simple way to disable validation while an ajax request is downloading the model from the server?
Let's say I have this input.
<input type="text" class="form-control" id="FieldName" name="FieldName"
ng-model="model.thefield" required ng-maxlength="100">
And this model which does not pass the validation initially:
$scope.model = {}
So, the input is invalid until the request finishes:
$http.get('/some/url')
.then(function (response) {
$scope.model = response.data;
});
Is there a way to disable validation until this request has finished. I currently set the model to a valid value initially. Example:
$scope.model = {
thefield: "loading"
}
requiredandng-maxlengthdo not work until the request is finished? Or you want to validate input field until the request is finished and after that it should not validate input?