I got pagination in angular done in $http.get
like that:
if (vm.currentPage <= 6) {
vm.pagination = _.range(1, 11);
}
if (vm.currentPage > 6) {
vm.pagination = _.range(vm.currentPage - 5, vm.currentPage + 5);
}
if (vm.currentPage > vm.maxPage - 5) {
vm.pagination = _.range(vm.maxPage - 10, vm.maxPage + 1)
}
<li ng-repeat='val in vm.pagination' class="page">
<a href="{{val}}" value="{{val}}">{{val}}</a>
</li>
I also got jquery function that i want to be execute after vm.pagination is updated on index.html:
$("a[value=" + vm.currentPage + "]").parent().addClass("active");
At this point i'm waiting to $http.get is finished, and execut jquery function after it, but still Angular add new li elements after everything is executed in controller.
How to make jquery function executed after Angular finish updated vm.pagination in view?