File

src/services/breadcrumb.service.ts

Index

Properties
Methods

Constructor

constructor()

Methods

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

Properties

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

@Injectable()
export class BreadcrumbService {
  public current: ReplaySubject<any>;
  private initialData: any = {
    description: '',
    display: false,
    header : '',

    levels: [
      {
        icon: 'clock-o',
        link: ['/'],
        title: 'Default'
      }
    ]
  };

  constructor() {
    this.current = new ReplaySubject(1);
    this.clear();
  }

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

  public getCurrent() {
    return this.current;
  }

  public clear() {
    this.setCurrent(this.initialData);
  }

}

results matching ""

    No results matching ""