Fixing select Room
This commit is contained in:
parent
124f3eef4c
commit
bfb828c15c
|
@ -137,7 +137,7 @@
|
||||||
<div [formGroupName]="i" class="">
|
<div [formGroupName]="i" class="">
|
||||||
<div class="input-group mb-1">
|
<div class="input-group mb-1">
|
||||||
<select
|
<select
|
||||||
id="roomId"
|
id="roomId{{i}}"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
formControlName="roomId"
|
formControlName="roomId"
|
||||||
(change)="validateDouble($event, i)"
|
(change)="validateDouble($event, i)"
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
*ngFor="let list of dataRoomList"
|
*ngFor="let list of dataRoomList; trackBy: trackByFn"
|
||||||
[value]="list.id"
|
[value]="list.id"
|
||||||
>
|
>
|
||||||
{{ list.name }}
|
{{ list.name }}
|
||||||
|
|
|
@ -251,8 +251,6 @@ export class AddEditListComponent {
|
||||||
|
|
||||||
dataListRoom() {
|
dataListRoom() {
|
||||||
this.monitoringApiService.getListRoomDataUnmap().subscribe((data) => {
|
this.monitoringApiService.getListRoomDataUnmap().subscribe((data) => {
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
const newArray = data.data.map((item) => ({
|
const newArray = data.data.map((item) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: `${item.name} (${item.code})`,
|
name: `${item.name} (${item.code})`,
|
||||||
|
@ -260,6 +258,9 @@ export class AddEditListComponent {
|
||||||
this.dataRoomList = newArray;
|
this.dataRoomList = newArray;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
trackByFn(index: number, option: any): any {
|
||||||
|
return option.id;
|
||||||
|
}
|
||||||
|
|
||||||
dataListFloor() {
|
dataListFloor() {
|
||||||
this.monitoringApiService.getListFloorDataUnmap(6).subscribe((data) => {
|
this.monitoringApiService.getListFloorDataUnmap(6).subscribe((data) => {
|
||||||
|
|
Loading…
Reference in New Issue