Skip to content

Instantly share code, notes, and snippets.

@trubachoff
trubachoff / abstract-component.ts
Created October 18, 2021 12:12
Angular abstract onDestroy calss
import { Subject } from 'rxjs';
import { Injectable, OnDestroy } from '@angular/core';
@Injectable()
export class AbstractBasicComponent implements OnDestroy {
protected destroy$ = new Subject();
public ngOnDestroy(): void {
this.destroy$.next();