This commit is contained in:
geek 2018-06-11 20:28:05 +09:00
parent e908945d3e
commit 0bffcfb03b
3 changed files with 11 additions and 2 deletions

View File

@ -31,6 +31,7 @@
</ng-template>
</p-table>
<p-paginator #paginator [rows]="targetPage.size" [totalRecords]="targetPage.totalElements"
(onPageChange)="onPaginate($event)" ></p-paginator>
(onPageChange)="onPaginate($event)"></p-paginator>
</ng-template>

View File

@ -26,6 +26,7 @@ import { TargetService } from '../../service/target.service';
import { Paginator } from 'primeng/primeng';
import { Page, PageParams} from '@overflow/commons-typescript';
import {PlatformLocation} from '@angular/common';
@Component({
selector: 'of-target-list',
@ -47,10 +48,16 @@ export class ListComponent implements OnInit, OnChanges {
constructor(
private store: Store<any>,
private targetService: TargetService,
private location: PlatformLocation
) {
}
ngOnInit() {
this.location.onPopState(() => {
// alert(window.location);
this.paginator.changePage(this.pageIdx);
});
this.getTargetList();
}
@ -103,6 +110,7 @@ export class ListComponent implements OnInit, OnChanges {
}
onPaginate(e) {
// e.changePage();
this.pageChange.emit(e.page);
}
}

View File

@ -14,7 +14,7 @@ export class TargetDetailPageComponent implements OnInit {
private activatedRoute: ActivatedRoute
) {
this.targetID = this.activatedRoute.snapshot.params['targetID'];
console.log(this.targetID);
// console.log(this.targetID);
}
ngOnInit() {