Created
April 25, 2018 17:24
-
-
Save alxhub/abf713e1a64a58f80e03df5aa400eec7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable | |
export class OnDestroySvc { | |
private _other: OnDestroy[] = []; | |
register(other: OnDestroy) { | |
this._other.push(other); | |
} | |
ngOnDestroy(): void { | |
this._other.forEach(svc => svc.onDestroy()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment