There seems to be an issue in Angular 1 with ng-value not working properly with ng-required. When you run the following code, it shows "The input field cannot be empty" even though it has the value of "John". However, when you enter a different value or remove something from the input field, the required message disappears.
Does anyone have a solution for this?
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="">
<form name="myForm">
Click here to make the input field required:
<div ng-app="" ng-init="firstName='John'">
<input name="myInput" ng-model="myInput" ng-value="firstName" ng-required="true">
<h1 ng-if="!myForm.myInput.$valid">The input field cannot be empty</h1>
</form>
</body>
</html>