Angular - RxJS and Observables Fundamentals
Consider this Angular component snippet:
What will happen if this component is created and destroyed multiple times without adding unsubscribe in
export class MyComponent implements OnDestroy {
private sub = this.service.getData().subscribe(data => console.log(data));
ngOnDestroy() {
// missing unsubscribe
}
}What will happen if this component is created and destroyed multiple times without adding unsubscribe in
ngOnDestroy?