<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 Include(包含) 使用 AngularJS, 你可以在 HTML 中包含 HTML 文件。 ## 在未來的HTML中包含 HTML 文件 在 HTML 中,目前還不支持包含 HTML 文件的功能。 W3C 已經建議 [http://www.w3.org](//www.w3.org/TR/html-imports) 在未來的 HTML 中支持包含HTML的功能,格式如下: ``` <link rel="import" href="/path/navigation.html"> ``` ## 服務端包含 大部分web服務器支持服務端腳本的包含 (**SSI:Server Side Includes**)。 使用 SSI, 你可以在HTML頁面發送至瀏覽器前包含 HTML。 ## PHP 實例 ``` <?php require("navigation.php"); ?> ``` ## 客戶端包含 客戶端在 HTML 中使用 JavaScript 有多種方式可以包含 HTML 文件。 通常我們使用 http 請求 (**AJAX**) 從服務端獲取數據,返回的數據我們可以通過 使用 **innerHTML** 寫入到 HTML 元素中。 ## AngularJS 包含 使用 AngularJS, 你可以使用 **ng-include** 指令來包含 HTML 內容: ## 實例 ``` <body> <div class="container"> ? <div ng-include="'myUsers_List.htm'"></div> ? <div ng-include="'myUsers_Form.htm'"></div> </div> </body> ``` 步驟如下。 ## 步驟 1: 創建 HTML 列表 ## myUsers_List.html ``` <table class="table table-striped"> ? <thead><tr> ??? <th>Edit</th> ??? <th>First Name</th> ??? <th>Last Name</th> ? </tr></thead> ? <tbody><tr ng-repeat="user in users"> ??? <td> ????? <button class="btn" ng-click="editUser(user.id)"> ??????? <span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;Edit ????? </button> ??? </td> ??? <td>{{ user.fName }}</td> ??? <td>{{ user.lName }}</td> ? </tr></tbody> </table> ``` ## 步驟 2: 創建 HTML 表單 ## myUsers_List.html ``` <button class="btn btn-success" ng-click="editUser('new')"> ? <span class="glyphicon glyphicon-user"></span> Create New User </button> <hr> <h3 ng-show="edit">Create New User:</h3> <h3 ng-hide="edit">Edit User:</h3> <form class="form-horizontal"> <div class="form-group"> ? <label class="col-sm-2 control-label">First Name:</label> ? <div class="col-sm-10"> ??? <input type="text" ng-model="fName" ng-disabled="!edit" placeholder="First Name"> ? </div> </div> <div class="form-group"> ? <label class="col-sm-2 control-label">Last Name:</label> ? <div class="col-sm-10"> ??? <input type="text" ng-model="lName" ng-disabled="!edit" placeholder="Last Name"> ? </div> </div> <div class="form-group"> ? <label class="col-sm-2 control-label">Password:</label> ? <div class="col-sm-10"> ??? <input type="password" ng-model="passw1" placeholder="Password"> ? </div> </div> <div class="form-group"> ? <label class="col-sm-2 control-label">Repeat:</label> ? <div class="col-sm-10"> ??? <input type="password" ng-model="passw2" placeholder="Repeat Password"> ? </div> </div> </form> <hr> <button class="btn btn-success" ng-disabled="error || incomplete"> ? <span class="glyphicon glyphicon-save"></span> Save Changes </button> ``` ## 步驟 3: 創建主頁 ## myUsers.html ``` <!DOCTYPE html> <html ng-app=""> <head> <link rel="stylesheet" href = "http://apps.bdimg.com/libs/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-controller="userController"> <div class="container"> <div ng-include="'myUsers_List.htm'"></div> <div ng-include="'myUsers_Form.htm'"></div> </div> <script src= "http://apps.bdimg.com/libs/angular.js/1.2.15/angular.min.js"></script> <script src= "myUsers.js"></script> </body> </html> ```
                  <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>

                              哎呀哎呀视频在线观看