From 0bffcfb03b412d2eadab8825184cf6e536742752 Mon Sep 17 00:00:00 2001 From: geek Date: Mon, 11 Jun 2018 20:28:05 +0900 Subject: [PATCH] ing --- @overflow/target/component/list/list.component.html | 3 ++- @overflow/target/component/list/list.component.ts | 8 ++++++++ src/app/pages/targets/target-detail-page.component.ts | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/@overflow/target/component/list/list.component.html b/@overflow/target/component/list/list.component.html index 71c85b3..de9c49b 100644 --- a/@overflow/target/component/list/list.component.html +++ b/@overflow/target/component/list/list.component.html @@ -31,6 +31,7 @@ + (onPageChange)="onPaginate($event)"> + diff --git a/@overflow/target/component/list/list.component.ts b/@overflow/target/component/list/list.component.ts index b533efb..e4ea0a1 100644 --- a/@overflow/target/component/list/list.component.ts +++ b/@overflow/target/component/list/list.component.ts @@ -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, 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); } } diff --git a/src/app/pages/targets/target-detail-page.component.ts b/src/app/pages/targets/target-detail-page.component.ts index b41f2da..92a9f52 100644 --- a/src/app/pages/targets/target-detail-page.component.ts +++ b/src/app/pages/targets/target-detail-page.component.ts @@ -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() {