pages + refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
@@ -11,8 +11,7 @@ import { PageEvent } from '@angular/material/paginator';
|
||||
})
|
||||
export class PageTop implements OnInit {
|
||||
|
||||
|
||||
@Input() entries: any;
|
||||
entries: any;
|
||||
boundRefresh: Function;
|
||||
boundUpdate: Function;
|
||||
init: boolean = true;
|
||||
@@ -48,7 +47,7 @@ export class PageTop implements OnInit {
|
||||
}
|
||||
|
||||
this.entries.content = null;
|
||||
this.entriesService.getPages(this.entries.number || 0, this.entries.size || 30).subscribe((data: any) => {
|
||||
this.entriesService.getRanked(this.entries.number || 0, this.entries.size || 30).subscribe((data: any) => {
|
||||
this.entries = data;
|
||||
}, (error) => { })
|
||||
|
||||
@@ -74,7 +73,7 @@ export class PageTop implements OnInit {
|
||||
queryParamsHandling: 'merge'
|
||||
});
|
||||
|
||||
this.entriesService.getPages(event.pageIndex, event.pageSize).subscribe((data: any) => {
|
||||
this.entriesService.getRanked(event.pageIndex, event.pageSize).subscribe((data: any) => {
|
||||
this.entries = data;
|
||||
}, (error) => { })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user