Projekt

Obecné

Profil

Stáhnout (1.83 KB) Statistiky
| Větev: | Tag: | Revize:
1 a3ae1cab hlavja
<p-dialog [visible]="isVisible" [closable]="false" [draggable]="false" header="Add unit!" [style]="{width: '50vw'}" [baseZIndex]="10000" (onShow)="clearFormArray()">
2
3
  <form [formGroup]="insertForm">
4
    <div class="input-group form-group">
5
      <input type="text" formControlName="unitId" class="form-control" id="unitId" placeholder="unitId"/>
6
    </div>
7
    <div class="input-group form-group">
8
      <input type="text" formControlName="unitDescription" class="form-control" id="unitDescription" placeholder="unitDescription"/>
9
    </div>
10
    <div class="input-group form-group">
11
      <div formArrayName="sensors" *ngFor="let item of insertForm.get('sensors')['controls']; let i = index;">
12
        <div [formGroupName]="i">
13
          <input type="text" formControlName="sensorId" class="form-control" id="sensorId" placeholder="sensorId"/>
14
          <input type="text" formControlName="sensorName" class="form-control" id="sensorName" placeholder="sensorName"/>
15
          <input type="text" formControlName="sensorType" class="form-control" id="sensorType" placeholder="sensorType"/>
16
          <select formControlName="phenomenons" id="phenomenons">
17
            <option *ngFor="let phenomenon of phenomenons; let i = index" [value]="phenomenons[i].phenomenonId">
18
              {{phenomenons[i].phenomenonName}} ( {{ phenomenons[i].unit}})
19
            </option>
20
          </select>
21
        </div>
22
        <br>
23
      </div>
24
    </div>
25
  </form>
26
27
28
  <button type="button" (click)="addSensor()">Add Sensor</button>
29
30
31
32
33
34
35
36
  <p-footer>
37
    <div class="row justify-content-end align-items-center">
38
      <div>
39
        <p-button icon="pi pi-check" (click)="processInsertion()" type="submit" label="Uložit" class="pr-2"></p-button>
40
        <p-button icon="pi pi-times" (click)="close()" label="Zavřít" class="pr-2"></p-button>
41
      </div>
42
    </div>
43
  </p-footer>
44
</p-dialog>