Created
September 28, 2019 07:34
-
-
Save dujo-stack/31a8188f249a8575ffbab19d35c79c58 to your computer and use it in GitHub Desktop.
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
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class DataService { | |
private messageSource = new BehaviorSubject(''); | |
currentMessage = this.messageSource.asObservable(); | |
constructor() { } | |
changeMessage(message: string) { | |
this.messageSource.next(message) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment