<!--ng-model 指令可以为应用数据提供状态值(invalid, dirty, touched, error):-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="js/angular.js"></script>
</head>
<body>
<form ng-app="" name="myForm" ng-init="myText = 'test@runoob.com'">
Email:
<input type="email" name="myAddress" ng-model="myText" required></p>
<h1>状态</h1>
{{myForm.myAddress.$valid}}
{{myForm.myAddress.$dirty}}
{{myForm.myAddress.$touched}}
</form>
</body>
</html>
08-指令ng-model应用状态
最新推荐文章于 2021-01-24 03:44:57 发布