Skip to content

Instantly share code, notes, and snippets.

@bogdanconstantinescu
Created November 8, 2019 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogdanconstantinescu/c5b998ebb1682ae1e5a97dc4f75a5bd0 to your computer and use it in GitHub Desktop.
Save bogdanconstantinescu/c5b998ebb1682ae1e5a97dc4f75a5bd0 to your computer and use it in GitHub Desktop.
Angular BaseComponent
import { OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
export abstract class BaseComponent implements OnDestroy {
public ngDestroyed$ = new Subject();
ngOnDestroy() {
this.ngDestroyed$.next();
this.ngDestroyed$.unsubscribe();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment