feat(dashboard): add logic for temperature dragger

This commit is contained in:
KostyaDanovsky 2017-07-07 19:54:49 +03:00
parent ce8055ca84
commit 2ed871ff20
13 changed files with 262 additions and 47 deletions

View file

@ -8,9 +8,19 @@ import { NgaThemeService } from '@akveo/nga-theme';
<nga-card size="xmedium">
<nga-tabset fullWidth>
<nga-tab tabTitle="Temperature">
<ngx-temperature-dragger [(value)]="temperature" [arcThickness]="20" [knobRadius]="15" [bottomAngle]="90"
[disableArcColor]="themeConfig.layoutBg"
<ngx-temperature-dragger [(value)]="temperature" (power)="powerOff = !$event" [min]="12" [max]="30"
[arcThickness]="20" [knobRadius]="15" [bottomAngle]="90" [disableArcColor]="themeConfig.layoutBg"
[fillColors]="[themeConfig.colorInfo, themeConfig.colorSuccess, themeConfig.colorWarning]">
<div class="temperature" [ngClass]="{ 'off': powerOff }">
<div class="value">
{{ powerOff ? '--' : (temperature | ngxRound) }}
</div>
<div class="desc">
Celsius
</div>
</div>
</ngx-temperature-dragger>
</nga-tab>
<nga-tab tabTitle="Humidity">
@ -21,12 +31,14 @@ import { NgaThemeService } from '@akveo/nga-theme';
`,
})
export class TemperatureComponent {
temperature = 0.5;
themeConfig = {};
temperature: number = 23;
powerOff: boolean = false;
themeConfig: any = {};
constructor(private theme: NgaThemeService) {
this.theme.getConfig().subscribe((config) => {
this.theme.getConfig().subscribe(config => {
this.themeConfig = config;
});
}