Created
December 11, 2018 12:11
-
-
Save Mulperi/22c71d7127d542ef95b16d337a15b5bd to your computer and use it in GitHub Desktop.
Dynamic component service
This file contains 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
export class DynamicComponentService { | |
latestComponent = new BehaviorSubject<any>(null); | |
getLatestComponentStream(): Observable<any> { | |
return this.latestComponent.asObservable(); | |
} | |
pushComponent(component: any): void { | |
this.latestComponent.next(component); | |
} | |
removeLatestComponent(): void { | |
this.latestComponent.next(null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment