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

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

View File

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

View File

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