import { Injectable } from '@angular/core' ; import { Subject } from 'rxjs' ; import { Notification } from '../models/notification.model' ; @ Injectable ( ) export class NotificationsService { private notifications = new Subject < Notification > ( ) ; public noteAdded = this . notifications . asObservable ( ) ; public add ( notification ) { this . notifications . next ( notification ) ; } }