Reputation: 685
How do I unsubscribe an observable if it's converted to promise? I'm using RxJS in Angular 2
import 'rxjs/add/operator/toPromise';
return this.http.get(this.heroesUrl)
.toPromise()
.then(this.extractData)
Upvotes: 6
Views: 7935
Reputation: 55443
If you subscribe to an Observable then it is possible to unsubscribe to it.
When you return promise(here it seems you return promise -not observable), you usually don't subscribe to it. right??
So you can't unsubscribe to it(promise).
Upvotes: 16