2017-07-13 11:49:38 +03:00
|
|
|
import { Component } from '@angular/core';
|
2017-08-04 15:11:32 +03:00
|
|
|
import { NbThemeService } from '@nebular/theme';
|
|
|
|
|
|
2017-07-14 18:55:38 +03:00
|
|
|
import { ElectricityService } from '../../../@core/data/electricity.service';
|
2017-07-11 18:59:08 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-electricity',
|
|
|
|
|
styleUrls: ['./electricity.component.scss'],
|
|
|
|
|
templateUrl: './electricity.component.html',
|
|
|
|
|
})
|
2017-07-13 11:49:38 +03:00
|
|
|
export class ElectricityComponent {
|
2017-07-11 18:59:08 +03:00
|
|
|
|
2017-07-14 18:55:38 +03:00
|
|
|
data: Array<any>;
|
|
|
|
|
|
2017-07-24 19:10:59 +03:00
|
|
|
type: string = 'week';
|
|
|
|
|
types = ['week', 'month', 'year'];
|
|
|
|
|
|
2017-08-04 15:11:32 +03:00
|
|
|
currentTheme: string;
|
|
|
|
|
|
|
|
|
|
constructor(private eService: ElectricityService, private themeService: NbThemeService) {
|
|
|
|
|
this.data = eService.getData();
|
|
|
|
|
|
|
|
|
|
this.themeService.getJsTheme().subscribe(theme => {
|
|
|
|
|
this.currentTheme = theme.name;
|
|
|
|
|
});
|
2017-07-14 18:55:38 +03:00
|
|
|
}
|
2017-07-11 18:59:08 +03:00
|
|
|
}
|