2016-04-28 40 views
0

我使用AngularJS分頁來創建頁面鏈接。AngularJS分頁禁用數據加載鏈接

<pagination total-items="totalItems" max-size="'10'" 
       ng-model="currentPage" ng-change="pageChanged()"></pagination> 

如何在數據加載時禁用鏈接?

回答

1
  1. 使用布爾值$scope變量比如說,$scope.fetching = false
  2. ng-disabled添加到您的<pagination>指令中。

    <pagination total-items="totalItems" max-size="'10'" 
         ng-model="currentPage" ng-change="pageChanged() 
         ng-disabled="fetching"></pagination> 
    
  3. 在你pageChanged功能,在功能上設置$scope.fetching = true和你pageChanged功能的設置到底$scope.fetching = false