import { Injectable } from "@angular/core"; import { BehaviorSubject, Observable, Subject } from "rxjs"; import { NotificationElement } from "../components/notification-bar/notification-bar.component"; @Injectable() export class NotificationService { notification$ = new Subject(); push(notification: NotificationElement): void { console.log(notification.type + ": " + notification.message); this.notification$.next(notification); } }