Programming Code Center(PCC)
[ANGULARJS]

(PCC)::[How-to-use-A-form-and-its-current-validation-status-in-AngularJS]::[angularjs]

File Name : index.html

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>

<form ng-app="" name="myForm" ng-init="myText = 'post@myweb.com'">

Email:
<input type="email" name="myAddress" ng-model="myText" required>
<p>Edit the e-mail address, and try to change the status.</p>
<h1>Status</h1>
<p>Valid: {{myForm.myAddress.$valid}} (if true, the value meets all criteria).</p>
<p>Dirty: {{myForm.myAddress.$dirty}} (if true, the value has been changed).</p>
<p>Touched: {{myForm.myAddress.$touched}} (if true, the field has been in focus).</p>

</form>

</body>
</html>

Output :

Email:

Edit the e-mail address, and try to change the status.

Status

Valid: {{myForm.myAddress.$valid}} (if true, the value meets all criteria).

Dirty: {{myForm.myAddress.$dirty}} (if true, the value has been changed).

Touched: {{myForm.myAddress.$touched}} (if true, the field has been in focus).