autoPaging bug fixed

This commit is contained in:
Daniel Herrero 2018-05-20 19:18:05 +02:00
parent 4ce1af97df
commit f612cab8c0
1 changed files with 4 additions and 2 deletions

View File

@ -2,13 +2,14 @@ import ngModule from '../../module';
import getWatchers from '../../lib/get-watchers';
class AutoPaging {
constructor($http, $window, $element, $timeout, vnApp, $translate) {
constructor($http, $window, $element, $timeout, vnApp, $translate, $scope) {
this.$http = $http;
this.$window = $window;
this.$element = $element;
this.$timeout = $timeout;
this.vnApp = vnApp;
this.$translate = $translate;
this.$scope = $scope;
this.numPerPage = null;
this.maxItems = 0;
@ -31,6 +32,7 @@ class AutoPaging {
res.instances.forEach(item => {
this.items.push(item);
});
this.$scope.$apply();
this.checkWatchers();
});
if (this.index.filter.page == this.numPages) {
@ -108,7 +110,7 @@ class AutoPaging {
}
}
AutoPaging.$inject = ['$http', '$window', '$element', '$timeout', 'vnApp', '$translate'];
AutoPaging.$inject = ['$http', '$window', '$element', '$timeout', 'vnApp', '$translate', '$scope'];
ngModule.component('vnAutoPaging', {
template: require('./auto-paging.html'),