I have an angular application where I am reading a file and processing it and this processing is part of observable.
I have a service which returns the observable an (ngbus
You must unsubscribe from the subscription, not the observable:
processItems() {
const ngbusy = this.myservice.observable.subscribe(items => {
// perform some business logic
// unsubscribe at some point...
ngbusy.unsubscribe();
});
// this will unsubscribe immediately...
ngbusy.unsubscribe();
}