ObjectUnsubscribedError: object unsubscribed error when I am using ngx-progress in angular 2

前端 未结 4 1009
自闭症患者
自闭症患者 2021-02-04 03:12

I am using ngx-progressbar bar in Angular 2 application. When app loading first it is working fine. second time it is showing error. I referred few article like medium.com for s

4条回答
  •  逝去的感伤
    2021-02-04 03:35

    I also faced the same issue, I was using BehaviorSubject and it always saves the last response there are 2 solution for it.

    1. Use Subject instead of BehaviorSubject
    2. Simply add the below line inside the subscription.

      .next(undefined);

    Also remember to unsubscribe the subscriptions that you have created manually.

    I hope this helps.

提交回复
热议问题