Skip to content

Commit

Permalink
chore: change climate control
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaZhem committed Jul 18, 2024
1 parent 90e7e70 commit d3eba15
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
</h2>
</header>
<div class="group">
<tui-input-number [(ngModel)]="data.value">Room temperature С°</tui-input-number>
<tui-input-number [(ngModel)]="data.value2">Water temperature</tui-input-number>
<tui-input-number [(ngModel)]="data.value3">Air humidity, %</tui-input-number>
<tui-input-number
*ngFor="let input of climateControlService.climateControlData"
[(ngModel)]="input.value"
>
{{ input.name }}
</tui-input-number>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {TuiAppearance, tuiNumberFormatProvider} from '@taiga-ui/core';
import {TuiCardLarge} from '@taiga-ui/layout';
import {TuiInputNumberModule, tuiInputNumberOptionsProvider} from '@taiga-ui/legacy';

import {ClimateControlService} from '../../data/services/climate-control.service';
import {ClimateControlService} from './climate-control.service';

@Component({
standalone: true,
Expand All @@ -30,5 +30,5 @@ import {ClimateControlService} from '../../data/services/climate-control.service
],
})
export class ClimateControlComponent {
protected data = inject(ClimateControlService);
protected climateControlService = inject(ClimateControlService);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {Injectable} from '@angular/core';

interface ClimateControlData {
readonly name: string;
readonly value: number;
}

export const INITIAL_DATA: ClimateControlData[] = [
{name: 'Room temperature С°', value: 32},
{name: 'Water temperature', value: 0},
{name: 'Air humidity, %', value: 10},
];

@Injectable({
providedIn: 'root',
})
export class ClimateControlService {
public readonly climateControlData = INITIAL_DATA;
}

This file was deleted.

0 comments on commit d3eba15

Please sign in to comment.