Angular UI Bootstrap分页按钮不可单击

时间:2016-01-11 16:44:45

标签: javascript angularjs pagination

我的UI分页存在问题,分页加载在我的页面上但没有任何按钮可点击。有谁有这个问题?这是我的代码。

<div class="rs-agency">
    <!-- Real estate agency details -->
    <div class="agency-item" ng-repeat="Review in Reviews.slice(((currentPage-1)*itemsPerPage), ((currentPage)*itemsPerPage))">
        <!-- Name -->
        <h4><a href="#">{{Review.ReviewName}}</a></h4>
        <!-- Address -->
        <!-- Contact details -->
        <!-- About Agency -->
        <p>{{Review.ReviewContent}}</p>
        <a href="#" class="btn btn-color btn-sm">{{Review.ReviewDateTime}}</a>
    </div>
    <pager total-items="totalItems" ng-model="currentPage" items-per-page="ItemsPerPage"></pager>
</div>

Angular JS Code

$http({
    method: 'GET',
    url: 'http://localhost:62012/api/RestaurantReviews/getReviewByRestaurant/' + ID
}).success(function (response) {

    $scope.Reviews = response;
    TotalItems = $scope.Reviews.length;

    //Pagination
    $scope.totalItems = TotalItems;

    $scope.currentPage = 1;
    $scope.itemsPerPage = 5;

    $scope.maxSize = 5;
}).error(function (err) {
    alert(JSON.stringify(err));
})

1 个答案:

答案 0 :(得分:0)

HTML有一个错字。

<pager total-items="totalItems" 
        ng-model="currentPage" items-per-page="ItemsPerPage">
</pager>

应该是:

<pager total-items="totalItems" 
       ng-model="currentPage" items-per-page="itemsPerPage">
</pager>