How to cancel a subscription in Angular2

后端 未结 8 1541
忘了有多久
忘了有多久 2020-11-30 01:37

How does one cancel a subscription in Angular2? RxJS seems to have a dispose method, but I can\'t figure out how to access it. So I have code that has access to an EventEm

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 01:59

    Are you looking to unsubscribe?

    mySubscription.unsubscribe();
    

提交回复
热议问题