From 378c65c51457d5ac5b6169a9548bbd41eadefac3 Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 4 Jun 2018 13:15:09 +0900 Subject: [PATCH] ing --- @overflow/sensor/component/sensor-list.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/@overflow/sensor/component/sensor-list.component.ts b/@overflow/sensor/component/sensor-list.component.ts index e8c0724..48c709e 100644 --- a/@overflow/sensor/component/sensor-list.component.ts +++ b/@overflow/sensor/component/sensor-list.component.ts @@ -18,10 +18,10 @@ import { PageParams } from '@overflow/commons-typescript/model/commons/PageParam templateUrl: './sensor-list.component.html', }) export class SensorListComponent implements OnInit, OnChanges { - @Input() pageNo: number; @Output() select = new EventEmitter(); @Output() addSensor = new EventEmitter(); + pageNo = 1; page: Page; pending$: Observable; error$: Observable; @@ -37,10 +37,6 @@ export class SensorListComponent implements OnInit, OnChanges { } ngOnInit() { - if (undefined === this.pageNo || 1 > this.pageNo) { - this.pageNo = 0; - } - this.store.pipe( tap(() => { this.pending$ = of(true); @@ -48,7 +44,7 @@ export class SensorListComponent implements OnInit, OnChanges { select(AuthSelector.selectDomainMember), exhaustMap((domainMember: DomainMember) => { const pageParams: PageParams = { - pageNo: this.pageNo, + pageNo: this.pageNo - 1, countPerPage: 10, sortCol: 'id', sortDirection: 'descending', @@ -58,6 +54,7 @@ export class SensorListComponent implements OnInit, OnChanges { .pipe( map((page: Page) => { this.page = page; + this.generateSensorMap(); }), catchError(error => { this.error$ = of(error);