【发布时间】:2016-03-01 09:56:57
【问题描述】:
通过部分更改控制器中的值后,我的角度视图没有更新。当我执行 console.log 时,它会记录更改的值。
测试控制器
$scope.testitem = 0;
$scope.updatePagination = function(page, lastPage) {
console.log('Test ', + page + " " + lastPage); //works
$scope.testitem = page; //doesnt work
};
查看
p(ng-model="testitem") {{testitem}} test
div(st-pagination="", st-items-by-page="displayAmount", st-displayed-pages="7", class="pagination" st-template="/partials/pagination.custom.html")
分页.custom.html
nav(ng-if='pages.length >= 2')
ul.pagination
li.non-clickable(ng-repeat="page in pages", ng-class="{active: page==currentPage}", ng-controller="controller")
a( ng-click='selectPage(page); updatePagination(page, numPages)') {{page}}
【问题讨论】:
标签: angularjs view controller smart-table