Rumah > Soal Jawab > teks badan
$scope.paginationConf = {
currentPage: 1,
itemsPerPage: 1
};
$scope.$watch('paginationConf.currentPage + paginationConf.itemsPerPage', $scope.reGetProducts);
reGetProducts封装了请求函数,$watch用来监听页码的改变,当页码变动的时候会重新请求数据,现在只想在单击后才去调用.
但是页面加载后直接就执行了函数,
漂亮男人2017-05-15 17:03:32
$scope.reGetProducts = function (newValue, oldValue) {
if (newValue === oldValue)return;
//todo
};