2017-07-06 19:10:31 +03:00
|
|
|
import { Component } from '@angular/core';
|
2017-07-06 22:33:06 +03:00
|
|
|
import { NgaThemeService } from '@akveo/nga-theme';
|
2017-07-06 19:10:31 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-temperature',
|
|
|
|
|
styleUrls: ['./temperature.component.scss'],
|
|
|
|
|
template: `
|
|
|
|
|
<nga-card size="xmedium">
|
|
|
|
|
<nga-tabset fullWidth>
|
|
|
|
|
<nga-tab tabTitle="Temperature">
|
2017-07-07 19:54:49 +03:00
|
|
|
<ngx-temperature-dragger [(value)]="temperature" (power)="powerOff = !$event" [min]="12" [max]="30"
|
2017-07-10 14:05:02 +03:00
|
|
|
[arcThickness]="20" [knobRadius]="15" [bottomAngle]="90" [disableArcColor]="themeConfig.layoutBg"
|
2017-07-06 22:33:06 +03:00
|
|
|
[fillColors]="[themeConfig.colorInfo, themeConfig.colorSuccess, themeConfig.colorWarning]">
|
2017-07-07 19:54:49 +03:00
|
|
|
|
|
|
|
|
<div class="temperature" [ngClass]="{ 'off': powerOff }">
|
|
|
|
|
<div class="value">
|
|
|
|
|
{{ powerOff ? '--' : (temperature | ngxRound) }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="desc">
|
|
|
|
|
Celsius
|
2017-07-10 14:05:02 +03:00
|
|
|
</div>
|
2017-07-07 19:54:49 +03:00
|
|
|
</div>
|
2017-07-10 14:05:02 +03:00
|
|
|
|
2017-07-06 19:10:31 +03:00
|
|
|
</ngx-temperature-dragger>
|
|
|
|
|
</nga-tab>
|
|
|
|
|
<nga-tab tabTitle="Humidity">
|
|
|
|
|
<span>Content #2</span>
|
|
|
|
|
</nga-tab>
|
|
|
|
|
</nga-tabset>
|
|
|
|
|
</nga-card>
|
|
|
|
|
`,
|
|
|
|
|
})
|
|
|
|
|
export class TemperatureComponent {
|
2017-07-06 22:33:06 +03:00
|
|
|
|
2017-07-07 19:54:49 +03:00
|
|
|
temperature: number = 23;
|
|
|
|
|
powerOff: boolean = false;
|
|
|
|
|
|
|
|
|
|
themeConfig: any = {};
|
2017-07-06 22:33:06 +03:00
|
|
|
|
|
|
|
|
constructor(private theme: NgaThemeService) {
|
2017-07-07 19:54:49 +03:00
|
|
|
this.theme.getConfig().subscribe(config => {
|
2017-07-06 22:33:06 +03:00
|
|
|
this.themeConfig = config;
|
|
|
|
|
});
|
|
|
|
|
}
|
2017-07-06 19:10:31 +03:00
|
|
|
}
|