Created
August 2, 2019 08:41
-
-
Save ngohungphuc/0b05de80ff36e30bb8f9712b58c20e9f 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
| import { Injectable } from "@angular/core"; | |
| import { Subject } from "rxjs"; | |
| @Injectable() | |
| export class MessageService { | |
| private subject = new Subject<any>(); | |
| constructor() {} | |
| sendMessage(message: any) { | |
| this.subject.next(message); | |
| } | |
| getData() { | |
| return this.subject.asObservable(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment