Angular - Convert a Observable to a number

前端 未结 2 737
傲寒
傲寒 2021-01-14 06:35

I\'m using ngrx store to record state, my state currently holds my list of accounts and the current page (for paging).

On my list of accounts component i call the st

2条回答
  •  再見小時候
    2021-01-14 07:17

    subscribe to get result as number:

    let currentPageSub :Subscription;
    ...
    this.currentPageSub = this.store.select(getCurrentPage).subscribe(
     (page: number) => {
         this.currentPage$=page;
     }
    );
    

提交回复
热议问题