<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>angularjs-validate</title>
<script type="text/javascript" src="js/angular.min.js"></script>
</head>
<body>
<form name="form1" id="form1">
账号:<input type="text" name="username" ng-model="username" required>
<span style="color:red" ng-show="form1.username.$dirty && form1.username.$invalid">
<span ng-show="form1.username.$error.required">请输入账号</span>
</span>
<br />
邮箱:<input type="text" name="email" ng-model="email" required>
<span style="color:red" ng-show="form1.email.$dirty && form1.email.$invalid">
<span ng-show="form1.email.$error.required">请输入邮箱</span>
</span> <p>
<input type="submit" ng-disabled="form1.username.$dirty && form1.username.$invalid || form1.email.$dirty && form1.email.$invalid">
</p>
</form>
<script>
var app = angular.module('myApp', []);
</script>
</body>
</html>

最新文章

  1. node使用xml-writer生成本地XML文件实例
  2. angular学习笔记(二十八-附2)-$http,$resource中的promise对象
  3. Redis作为消息队列服务场景应用案例
  4. 数据库开发基础-SQl Server 变量、运算符、if、while
  5. SHOW OPEN TABLES – what is in your table cache
  6. 002..NET MVC实现自己的TempBag
  7. poi设置excel表格边框、字体等
  8. AtomicInteger类的理解及使用
  9. SPFA小总结
  10. 3D Slicer Hide 3D Cube and Axis Labels Programmatically 使用代码隐藏三维视图中的方框和坐标轴标签
  11. 560. Subarray Sum Equals K 求和为k的子数组个数
  12. 524 (Div. 2) Masha and two friends
  13. 杜教BM
  14. CSS定位之position详解
  15. AIX平台安装Oracle11gR2数据库
  16. Activiti学习之 多实例实现会签功
  17. 最小生成树问题------------Prim算法(TjuOj_1924_Jungle Roads)
  18. 03: MySQL基本操作
  19. fiddler script建议教程
  20. 安装php扩展redis (windows环境)

热门文章

  1. apache 占用内存总量与每个apache进程的平均内存占用量计算
  2. HTML的介绍
  3. LBP,LBP-TOP的MATLAB公开代码
  4. 使用Nginx的配置对cc攻击进行简单防御
  5. Flask实战第38天:前台模型创建
  6. 【BZOJ 1060】 1060: [ZJOI2007]时态同步 (树形DP)
  7. Codeforces 555 C. Case of Chocolate
  8. 实验四实验报告————Android基础开发
  9. [bzoj1009](HNOI2008)GT考试 (kmp+矩阵快速幂加速递推)
  10. 你一定喜欢看的 Webpack 2.&#215; 入门实战(转载)