<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 功能強大 支持多語言、二開方便! 廣告
                和上一章節中的思路相同,我們仍然將獲取單條數據的信息寫入至M(klass)中. # klass.js ``` ... // 獲取單條數據 var get = function(id, callback) { server.http({ method:'GET', url: '/klass.Get.json?id=' + id }, function(response) { callback(response); }); }; ... // Public API here return { // 獲取全部教師信息 paginate: function(name, page, pageSize, callback) { return paginate(name, page, pageSize, callback); }, save: save, get: get }; ``` ## 單元測試 test/..../klass.js ``` ... // 進行模似數據請求配置.當請求方法為post,資源名為url時, 返回data數據. $httpBackend.when('POST', url).respond(data); // 增加GET的測試 url = config.apiRootPath + '/klass.Get.json?id=1'; $httpBackend.when('GET', url).respond(data); })); ... // 調用保存 klass.save({name:'name', teacherId:3}, function(){ console.log('klass save 通過'); }); // 調用GET klass.get(1, function(){ console.log('klass get 通過'); }); // 模擬數據請求 $httpBackend.flush(); ... ``` ## 控制臺數據: ``` PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 11 of 15 SUCCESS (0 secs / 0.069 secsLOG: 'klass save 通過' PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 11 of 15 SUCCESS (0 secs / 0.069 secsLOG: 'klass get 通過' ``` # C與M對接 klass/edit.js ``` // 獲取當前班級信息 var getKlass = function() { klass.get($scope.klass.id, function(response) { $scope.klass = response.klass; }); }; ``` ## 測試 [./image/4.4.1.png](./image/4.4.1.png) > git checkouf -f step12.4.4
                  <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>

                              哎呀哎呀视频在线观看