File

src/services/container.services.ts

Index

Properties
Methods

Methods

addTab
addTab(tab: TabOptions)
Parameters :
Name Type Optional
tab TabOptions No
Returns : void
getAllTabs
getAllTabs()
Returns : Array<any>
removeAllTabs
removeAllTabs()
Returns : void

Properties

Private tabs
Type : Array<TabOptions>
Default value : []
import { Injectable } from '@angular/core';

export interface TabOptions {
  root: any;
  icon?: string;
  label?: string;
  index?: number;
  isSelected?: boolean;
}

@Injectable()
export class ContainerService {

  private tabs: Array<TabOptions> = [];

  addTab(tab: TabOptions) {
    this.tabs.push(tab);
  }

  getAllTabs(): Array<any> {
    return this.tabs.sort((prev, next) => {
      return prev.index - next.index;
    });
  }

  removeAllTabs() {
    this.tabs = [];
  }

}


results matching ""

    No results matching ""