angularJs非空校验requied
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
<form action="demo-form.php">
<textarea name="comment" required></textarea>
<input type="submit">
</form>
<!--上下两种方案效果一样。加不加ng-disabled="form1.$invalid"目前看来是一样的-->
<form action="demo-form.php" name="form1">
<textarea name="comment" required></textarea>
<input type="submit" ng-disabled="form1.$invalid">
</form>
</body>
</html>
本博客中所有内容为本人自学及总结内容,
仅代表个人观点,如有错误,麻烦大家及时指出并提示我更正。谢谢