- this.userSubscriptionService.listSubscriptions()
- .subscribe(
- res => { console.log(res); this.videoChannels = res.data },
+ this.loadSubscriptions()
+ }
+
+ loadSubscriptions () {
+ this.userSubscriptionService.listSubscriptions(this.pagination)
+ .subscribe(
+ res => {
+ this.videoChannels = this.videoChannels.concat(res.data)
+ this.pagination.totalItems = res.total
+ },
+
+ error => this.notificationsService.error(this.i18n('Error'), error.message)
+ )
+ }
+
+ onNearOfBottom () {
+ // Last page
+ if (this.pagination.totalItems <= (this.pagination.currentPage * this.pagination.itemsPerPage)) return