为什么我在AngularJs中出现多个dir-pagination的错误?

时间:2017-07-13 12:13:24

标签: angularjs dirpagination

我有dir-pagination的问题。我有多个表,我添加到相同的dir-pagination属性'id'。

<tr dir-paginate="call in ( filterCalls = (calllRecords |  filter :searchInput 
                                            | filter:{typeCall:cats || undefined} | filter:{created_by:createdBySort} 
                                            | filter:{deleted: myFilter(cats)} |
                                            orderBy:orderByField:reverseSortArr[orderByField] |
                                             itemsPerPage: itemsPerPage))" pagination-id="callPagin">

我有这个指令

<dir-pagination-controls boundary-links="true" pagination-id="callPagin" on-page-change="pageChangeHandelr(newPageNumber)"></dir-pagination-controls>

我收到了这个错误:

Syntax Error: Token ':' is an unexpected token at column...

为什么会这样?

修改 角度控制器:

$scope.getCallsRecords = function(){

$http({
        method : "POST",
        url    : "/getCallRecords",
    }).success(function(res){
        $scope.calllRecords = res;
    });
}

$scope.getCallsRecords();

$scope.getAssignments = function(deleted = 0){

    $http({
        method : "POST",
        url    : "/getAssignment"
    }).success(function(res){
        $scope.assignments = res;

    });
}

$scope.getAssignments();

1 个答案:

答案 0 :(得分:0)

我解决了。我在tr标签中更改了dir-paginate属性。我删除了fillterCalls所以现在这个looke就像这样

<tr dir-paginate="call in calllRecords |  filter :searchInput 
                                       | filter:{typeCall:cats || undefined} 
                                       | filter:{created_by:createdBySort} 
                                       | filter:{deleted: myFilter(cats)} |  
                                       orderBy: orderByField : reverseSortArr[orderByField] 
                                       | itemsPerPage: itemsPerPage" 
                                       pagination-id="callPagin">