Skip to content

Instantly share code, notes, and snippets.



Created Jun 11, 2020
What would you like to do?
import {Injectable} from '@angular/core';
import {BehaviorSubject} from "rxjs";
providedIn: 'root'
export class DataSharingService {
private messageSource = new BehaviorSubject('default message');
currentMessage = this.messageSource.asObservable();
constructor() {
changeMessage(message: string) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment