This commit is contained in:
crusader 2018-06-04 13:15:09 +09:00
parent ad6907f7ba
commit 378c65c514

View File

@ -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<Sensor>();
@Output() addSensor = new EventEmitter();
pageNo = 1;
page: Page<Sensor>;
pending$: Observable<boolean>;
error$: Observable<any>;
@ -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<Sensor>) => {
this.page = page;
this.generateSensorMap();
}),
catchError(error => {
this.error$ = of(error);