import { Component, OnDestroy } from '@angular/core'; import { NbThemeService } from '@nebular/theme'; @Component({ selector: 'ngx-traffic', styleUrls: ['./traffic.component.scss'], template: ` Traffic Consumption
`, }) export class TrafficComponent implements OnDestroy { type: string = 'month'; types = ['week', 'month', 'year']; currentTheme: string; themeSubscription: any; constructor(private themeService: NbThemeService) { this.themeSubscription = this.themeService.getJsTheme().subscribe(theme => { this.currentTheme = theme.name; }); } ngOnDestroy() { this.themeSubscription.unsubscribe(); } }