Answer the question
In order to leave comments, you need to log in
Ng-model hides uploaded data from the server in input, how to fix it?
Hello everyone, here is the input code:
<input class="form-control ng-pristine ng-invalid ng-invalid-required ng-valid-minlength ng-valid-maxlength ng-touched" ng-model="title" required="required" ng-minlength="3" ng-maxlength="250" name="title" type="text" value="'First place is where I like to be': Shaquille O'Neal is a Northampton Town fan" id="title">
Answer the question
In order to leave comments, you need to log in
To make the fields use the value from the value attribute , you can write the following directive:
.directive('useFormData', function ($parse) {
return {
link: function (scope, element, attrs) {
if (attrs.ngModel && attrs.value) {
$parse(attrs.ngModel).assign(scope, attrs.value);
}
}
};
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question