src/services/container.services.ts
Properties |
|
Methods |
addTab | ||||||
addTab(tab: TabOptions)
|
||||||
Defined in src/services/container.services.ts:16
|
||||||
Parameters :
Returns :
void
|
getAllTabs |
getAllTabs()
|
Defined in src/services/container.services.ts:20
|
Returns :
Array<any>
|
removeAllTabs |
removeAllTabs()
|
Defined in src/services/container.services.ts:26
|
Returns :
void
|
Private tabs |
Type : Array<TabOptions>
|
Default value : []
|
Defined in src/services/container.services.ts:14
|
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 = [];
}
}