Я очень плохо знаком с AngularJS и пытаюсь учиться.Я застрял в месте и не смог ничего найти. Я пытаюсь выполнить нумерацию страниц:
Код JS ...
$scope.data = [];
$scope.currentPage = 0;
$scope.pageSize = 2;
$scope.q = '';
$scope.getData = function() {
// needed for the pagination calc
// https://docs.angularjs.org/api/ng/filter/filter
return $filter('filter')($scope.data, $scope.q)
}
$scope.numberOfPages = function() {
return Math.ceil($scope.getData().length / $scope.pageSize);
}
$scope.getJSONData = function(lst) {
$scope.data.push(lst);
}
// $scope.paginationPage();
}]);
app.filter('startFrom', function() {
return function(input, start) {
start = +start; //parse to int
var result = input.slice(start);
return result;
}
......
Я получаю сообщение об ошибке: Error: [$injector:unpr]
M DOM выглядит так:
<tr ng-repeat="p in data | startFrom:currentPage*pageSize |
limitTo:pageSize">
<td class="slds-cell-shrink" style="border:groove;">
<label class="slds-checkbox testclass">
<input type="checkbox" ng-model='p.vlcSelected' ng-change='onSelectItem(control, p, $index, this)'/>
<span class="slds-checkbox--faux"></span>
<span class="slds-assistive-text">Select</span>
</label>
</td>
Может кто-нибудь помочь, пожалуйста?