角度UI Bootstrap中on-select-page(页面)分页设置的目的是什么?

时间:2014-04-13 19:32:39

标签: angularjs angular-ui angular-ui-bootstrap

如文件angular ui bootstrap here中所述。我用它如下,但它似乎不起作用

<pagination 
            items-per-page="pagesize" 
            total-items="totalItems" 
            page="currentPage" 
            max-size="maxSize" 
            class="pagination-sm" 
            boundary-links="true" 
        rotate="false" 
        num-pages="numPages"
        on-select-page="refreshList"
>
</pagination>

并在我的控制器中添加了

$scope.refreshList = function(page){
    console.log(page);
    $scope.userlist();
}

但确实有效。函数没有被调用。我在哪里做错了?

2 个答案:

答案 0 :(得分:3)

在版本0.11.0 UI引导分页中,'page'和'onSelectPage'被替换为ng-model for page和ng-change for on-select-page。看看this

答案 1 :(得分:0)

它是一个表达式,因此您需要:refreshList()


<pagination 
        items-per-page="pagesize" 
        total-items="totalItems" 
        page="currentPage" 
        max-size="maxSize" 
        class="pagination-sm" 
        boundary-links="true" 
    rotate="false" 
    num-pages="numPages"
    on-select-page="refreshList()">
</pagination>