我正在使用Angularjs爲我的application.I面臨問題在使用分頁選項。我使用dir-paginate選項來創建分頁。分頁在angularjs 1.5
這裏是我的html
<tr data-dir-paginate="college in colleges | itemsPerPage: 10"
data-current-page="currentPage">
<td>{{$index + 1}}</td>
<td><a href="#!/collegedetails/{{college.collegeId}}">
{{college.name}}</a></td>
<td>{{college.typeName}}</td>
</tr>
這裏是我的Controller.js
var Controller = function($scope, $rootScope)
{
var app = angular.module('adminApp',
['angularUtils.directives.dirPagination']);
$scope.currentPage = 1;
$scope.itemsPerPage = 10;
$scope.getAllColleges = function()
{
AdminCollegeService.getAllColleges().then(function(response){
$scope.colleges=response.data;
});
}
}
我已經在我的索引包含dirPagination.js page.But現在顯示的是空page.Sometimes它只是不斷停止加載。我從控制器獲得響應,但我無法顯示在html.Am我缺少代碼中的東西?
,你可以把你的整個HTML。和你的整個控制器,因爲,只看到tr -repeat。 –