File

src/services/menu.service.ts

Index

Properties
Methods

Constructor

constructor(router: Router)
Parameters :
Name Type Optional Description
router Router

Methods

Public getCurrent
getCurrent()
Returns : any
Public setCurrent
setCurrent(menu: any)
Parameters :
Name Type Optional Description
menu any
Returns : void

Properties

Private current
current: ReplaySubject<any>
Type : ReplaySubject<any>
import { Injectable } from '@angular/core';
import { ReplaySubject } from 'rxjs/Rx';
import { Router } from '@angular/router';

@Injectable()
export class MenuService {
    private current: ReplaySubject<any> = new ReplaySubject<any>( 1 );

    constructor(
      private router: Router
    ) {}

    public setCurrent( menu: any ) {
      this.current.next( menu );
    }

    public getCurrent() {
      return this.current;
    }

}

results matching ""

    No results matching ""