import { Injectable } from '@angular/core' ; import { BehaviorSubject } from 'rxjs' ; @ Injectable ( ) export class SidePanelService { /** Emit the open state when it changes */ open$ = new BehaviorSubject < boolean > ( false ) ; open ( ) { this . open$ . next ( true ) ; } close ( ) { this . open$ . next ( false ) ; } }