import { Injectable } from '@angular/core' ; import { BehaviorSubject } from 'rxjs' ; /**
 * Preload a message into blogs.
 *
 * TODO: Retain linebreaks.
 */ @ Injectable ( { providedIn : 'root' } ) export class BlogPreloadService { /**
     * Message to be preloaded - publically accessible Observable
     */ public readonly message$ : BehaviorSubject < string > = new BehaviorSubject < string > ( '' ) ; returns { void } public clear ( ) { this . message$ . next ( '' ) ; } returns { void } public next ( message ) { this . message$ . next ( message ) ; } returns { string } public getValue ( ) { return this . message$ . getValue ( ) ; } }