ngx-admin/src/app/pages/dashboard/temperature/temperature.component.ts

32 lines
725 B
TypeScript
Raw Normal View History

import { Component, OnDestroy } from '@angular/core';
import { NbThemeService } from '@nebular/theme';
2017-07-06 19:10:31 +03:00
@Component({
selector: 'ngx-temperature',
styleUrls: ['./temperature.component.scss'],
templateUrl: './temperature.component.html',
2017-07-06 19:10:31 +03:00
})
export class TemperatureComponent implements OnDestroy {
temperature = 24;
temperatureOff = false;
temperatureMode = 'cool';
humidity = 87;
humidityOff = false;
humidityMode = 'heat';
2017-08-01 15:42:06 +03:00
colors: any;
themeSubscription: any;
constructor(private theme: NbThemeService) {
this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
2017-08-01 15:42:06 +03:00
this.colors = config.variables;
});
}
ngOnDestroy() {
this.themeSubscription.unsubscribe();
}
2017-07-06 19:10:31 +03:00
}