angularJS 入门基础(11)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>angular</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <script src=""></script>
    <script src=""></script>
    <link href="">
    <script src="" type="text/javascript"></script>
</head>
<body ng-app="app">
    <script type="text/javascript">
           var app = angular.module("app",[]);
    </script>
    <div>
        <div>
            ngPaste以及ngMouseup和ngKeyup,ngModelOptions....等方法参考官方的使用,要用查API就好了,(官方的要FQ哦;)
        </div>
        <script src="https://yearofmoo.github.io/ngMessages/angular-messages.js"></script>
        <div ng-controller="fromvaild">
            如果不用ng-message组件的错误提示如下;
        <form>
          <div>
            <label for="emailAddress">Enter your email address:</label>
            <input type="email" ng-model="data.email" required />
            <!-- this stuff is WAY too complex -->
            <div ng-if="userForm.emailAddress.$error.required">
              You forgot to enter your email address...
            </div>
            <div ng-if="!userForm.emailAddress.$error.required &&
                         userForm.emailAddress.$error.email">
              You did not enter your email address correctly...
            </div>
          </div>
          <input type="submit" />
        </form>
        <br>
        <a href="https://yearofmoo.github.io/ngMessages/">老外写的DEMO</a>
        </div>
        <script type="text/javascript">
            app.controller("fromvaild", function($scope) {
                //$scope.myField.$error = { minlength : true, required : false };
            })
        </script>
    </div>
</body>
</html>

setTimeout和setInterval都是经过angular包装过的,返回的是延迟对象的实例:

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgfxjj.html