Open mwj-1992 opened 7 years ago
Try to replace with $scope.watch Delete md-on-paginate Then in controller:
var bookmark;
self.query = {
'page': 1
};
$scope.$watch(angular.bind(this, function () {
return this.query;
}), function (newValue, oldValue) {
if(!oldValue) {
bookmark = self.query.page;
}
if(!newValue) {
self.query.page = bookmark;
}
getDate();
}, true);
when i'm using md-on-paginate and it's run multiple times Here is my code :+1: `
in controller: $socpe.paginate= function (page){ //assume page is 4 console.log('page'+page); }` the result is page 4 page 4 page 4 page 4 page 4 page 4