2015-10-30 47 views
0

我越來越Uncaught TypeError: bsTable.$s.$applyAsync is not a function。 HTML網頁代碼:Uncaught類型錯誤與引導表和角度與服務器端分頁

<div ng-app="testapp"> 
    <div ng-controller="MainController"> 
    <table bs-table-control="dashboardTableControl"></table> 
    </div> 
</div> 

JavaScript部分:

<script type="text/javascript"> 
    angular.module('testapp', ['bsTable']) 
    .controller('MainController', function($scope, $http) { 
     $scope.dashboardTableControl = { 
     options: { 
      url: "/tasks/", 
      cache: false, 
      height: 400, 
      striped: true, 
      pagination: true, 
      pageSize: 10, 
      pageList: [5, 10, 25, 50, 100, 200], 
      search: true, 
      showColumns: true, 
      showRefresh: false, 
      minimumCountColumns: 2, 
      clickToSelect: false, 
      showToggle: true, 
      maintainSelected: true, 
      sortName: "date_done", 
      sidePagination: "server", 
      columns: [{ 
      field: 'status', 
      title: 'Status', 
      sortable: true, 
      editable: true, 
      align: 'center' 
      }, { 
      field: '_id', 
      title: 'Task ID', 
      sortable: true, 
      editable: true, 
      align: 'center' 
      }, { 
      field: 'date_done', 
      title: 'Date Completed', 
      sortable: true, 
      editable: true, 
      align: 'center' 
      }] 
     } 
     }; 
    }); 
</script> 

我有進口的依賴關係爲:

<script type="text/javascript" src="/static/bower_components/bootstrap-table/src/bootstrap-table.js"></script> 
<script type="text/javascript" src="/static/bower_components/bootstrap-table/dist/extensions/angular/bootstrap-table-angular.js"></script> 

和我bower.json:

"bootstrap-table": "1.9.0", 
"angular": "~1.2.28", 
"angular-route": "~1.2.28", 
"angular-resource": "~1.2.28", 

也執行api retu任務rns結果爲:

{"rows": [{"status": "SUCCESS", "_id": "db672f91-cf56-4cf1-add2-216e7b069bbb", "date_done": "March 22, 2015 07:17:19 AM"}, {"status": "SUCCESS", "_id": "a44b670c-83c4-49ad-bbe4-11403c1b736e", "date_done": "March 22, 2015 07:17:29 AM"}, {"status": "SUCCESS", "_id": "ac60726e-edf7-4222-9cbb-88cfed5be69b", "date_done": "March 22, 2015 07:17:29 AM"}, {"status": "SUCCESS", "_id": "d3668982-bb3f-42b5-82eb-9b09ead36766", "date_done": "March 22, 2015 07:17:31 AM"}, {"status": "SUCCESS", "_id": "f97f89c1-53ff-4959-a2ad-2e7cfad37f48", "date_done": "March 22, 2015 07:17:41 AM"}, {"status": "SUCCESS", "_id": "84048949-ded1-4fe9-b699-d904c69d9d6c", "date_done": "March 22, 2015 07:17:42 AM"}, {"status": "SUCCESS", "_id": "3e06d66b-ba64-4d27-af8d-852356cd0063", "date_done": "March 22, 2015 07:17:44 AM"}, {"status": "SUCCESS", "_id": "82546768-461c-4474-9acb-0954e161e83c", "date_done": "March 22, 2015 07:17:52 AM"}, {"status": "SUCCESS", "_id": "92109e36-d27d-474a-a3e2-f34b743e3fbc", "date_done": "March 22, 2015 07:17:54 AM"}, {"status": "SUCCESS", "_id": "c4d6c39b-facc-4a88-8aa6-15753d7297ab", "date_done": "March 22, 2015 07:17:54 AM"}], "total": 109} 

我在哪裏犯錯?

+0

你可以創建小提琴或蹦牀。 – Harsh

回答

1

我剛剛得到了同樣的錯誤,我有以下變化解決

打開你的自舉表angular.js文件,並與$evalAsync

更換$applyAsync它解決了錯誤,因爲,因爲這是首選方法在Angular^1.4中。