为什么我在 AngularJs 中的多个目录分页时出错?
Why I get error on multiple dir-pagination in AngularJs?
我的目录分页有问题。我有多个表,我添加到同一个目录分页属性 '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...
为什么会这样?
编辑:
Angular 控制器:
$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();
我解决了。我更改了 tr 标签中的 dir-paginate 属性。我删除了 fillterCalls
所以现在看起来像这样
<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">
我的目录分页有问题。我有多个表,我添加到同一个目录分页属性 '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...
为什么会这样?
编辑: Angular 控制器:
$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();
我解决了。我更改了 tr 标签中的 dir-paginate 属性。我删除了 fillterCalls
所以现在看起来像这样
<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">