<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # AngularJS 表單 AngularJS 表單是輸入控件的集合。 ## HTML 控件 以下 HTML input 元素被稱為 HTML 控件: * input 元素 * select 元素 * button 元素 * textarea 元素 ## HTML 表單 HTML 表單通常與 HTML 控件同時存在。 ## AngularJS 表單實例 ``` <script>function ExampleController($scope) { $scope.master = {"firstName":"John","lastName":"Doe"}; $scope.reset = function() { $scope.user = angular.copy($scope.master); }; $scope.reset(); };</script> <form novalidate="" class="ng-pristine ng-valid">First Name: <input type="text" ng-model="user.firstName" class="ng-pristine ng-valid"> Last Name: <input type="text" ng-model="user.lastName" class="ng-pristine ng-valid"> <button ng-click="reset()">RESET</button></form> form = {"firstName":"John","lastName":"Doe"} master = {"firstName":"John","lastName":"Doe"} ``` ## 應用程序代碼 ``` <div ng-app="" ng-controller="formController"> ? <form novalidate> ??? First Name:<br> ??? <input type="text" ng-model="user.firstName"><br> ??? Last Name:<br> ??? <input type="text" ng-model="user.lastName"> ??? <br><br> ??? <button ng-click="reset()">RESET</button> ? </form> ? <p>form = {{user}}</p> ? <p>master = {{master}}</p> </div> <script> function formController ($scope) { ??? $scope.master = {firstName: "John", lastName: "Doe"}; ??? $scope.reset = function() { ??????? $scope.user = angular.copy($scope.master); ??? }; ??? $scope.reset(); }; </script> ``` > ![](https://box.kancloud.cn/2015-12-12_566b901025f8f.jpg) > HTML 屬性 **novalidate** 用于禁用瀏覽器的默認驗證。 ## 實例解析 AngularJS **ng-model** 指令用于綁定 input 元素到模型中。 模型對象 **master** 的值為 {"firstName" : "John", "lastName" : "Doe"}。 模型函數 **reset** 設置了模型對象 **user** 等于 master。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看