File

src/services/control-sidebar.service.ts

Index

Properties
Methods

Constructor

constructor()

Methods

Public close
close()
Returns : void
Public getCurrent
getCurrent()
Returns : any
Public open
open()
Returns : void
Public toggle
toggle()
Returns : void

Properties

Private current
current: ReplaySubject<any>
Type : ReplaySubject<any>
Private current_value
current_value:
Default value : false
Public default
default: any
Type : any
Default value : false
import { Injectable } from '@angular/core';
import { ReplaySubject } from 'rxjs/Rx';

@Injectable()
export class ControlSidebarService {
    private current: ReplaySubject<any> = new ReplaySubject<any>( 1 );
    public default: any = false;

    private current_value = false;

    constructor() {
      this.current.next( this.default );
    }

    public getCurrent(){
      return this.current;
    }

    public open() {
      this.current_value = true;
      this.current.next( this.current_value );
    }

    public close() {
      this.current_value = false;
      this.current.next( this.current_value );
    }

    public toggle(){
      this.current_value = !this.current_value;
      this.current.next( this.current_value );
    }
}

results matching ""

    No results matching ""