2018-10-05 17:00:54 +02:00
|
|
|
import { Injectable } from '@angular/core';
|
2017-12-06 17:45:54 +01:00
|
|
|
@Injectable()
|
|
|
|
export class PaginationService {
|
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
private currentPageIndex: number;
|
2017-12-06 17:45:54 +01:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
public setCurrentIndex(currentPageIndex: number): void {
|
|
|
|
this.currentPageIndex = currentPageIndex;
|
|
|
|
}
|
2017-12-06 17:45:54 +01:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
public getCurrentIndex(): number {
|
|
|
|
return this.currentPageIndex;
|
|
|
|
}
|
2017-12-06 17:45:54 +01:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
public isElementVisible(elementPage: number): boolean {
|
|
|
|
return elementPage === this.currentPageIndex; //TODO
|
|
|
|
}
|
|
|
|
}
|