x
 
<!DOCTYPE html>
<html>
<script src="https://cdn.staticfile.net/angular.js/1.6.9/angular.min.js"></script>  
<body ng-app="">
<p>请试着在输入框中输入一个电子邮件地址:</p>
<form name="myForm">
<input type="email" name="myInput" ng-model="myInput">
</form>
<p>输入框的有效状态是:</p>
<h1>{{myForm.myInput.$valid}}</h1>
<p>请注意,在您开始输入之前,即使输入框中不包含电子邮件地址,其状态也会显示为“true”。</p>
</body>
</html>