Data Table custom widget current page number binding

Hello,
I created a data table custom widget and I need to get a current page number in order to use Identity API such as

…/API/identity/user?p={{currentPage}}&c=10&o=lastname%20ASC&f=enabled%3dtrue

I could get the current page number inside widget like
{{ctrl.pagination.currentPage}}

I created a Bidirectional bond property to link together.
However, I dont get the right result.
I would appreciate if someone gives me an idea.

Thanks in advance


this.isChangagle = function () {
return $scope.properties.isBound(‘currentPage’);
};

this.updateResultsFromJson = function () {
$scope.properties.currentPage = vm.pagination.currentPage;
var start = (vm.pagination.currentPage - 1) * $scope.properties.pageSize;
var end = vm.pagination.currentPage * $scope.properties.pageSize;
vm.results = vm.jsonData.slice(start, end);
this.isChangagle();
};

Is it possible for you to share (using Google Drive, Dropbox…) your custom widget? I will give it a try and try to figure out how to handle properly the pagination.