Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cl-page-changed fires twice #3

Open
JimmyRitter opened this issue Dec 22, 2016 · 1 comment
Open

cl-page-changed fires twice #3

JimmyRitter opened this issue Dec 22, 2016 · 1 comment

Comments

@JimmyRitter
Copy link

Hello,
I'm getting something strange with cl-page-changed... When my list was filled, the function side cl-page-changed is called, so, it fires twice. The first time is when I click on my search button and make an AJAX, so the list is filled and the function is called again.

@jdjd1118
Copy link

jdjd1118 commented Apr 4, 2017

@JimmyRitter I changed the code in directive.js to prevent this:

$scope.$watch('clCurrentPage', function (value, oldValue) {
vm.index = parseInt((value - 1) / vm.clSteps) * vm.clSteps;
if(angular.isNumber(value) && !angular.equals(value, oldValue))
{
$scope.clPageChanged();
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants