Ajout du piège dans le formulaire

d'ajout de sauts
This commit is contained in:
Sébastien André
2019-11-23 16:54:09 +01:00
parent 3f7966091c
commit 47bdc0ac57
5 changed files with 21 additions and 18 deletions

View File

@@ -27,10 +27,11 @@
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-label>Choose the used Rig</mat-label> <mat-label>Choose the used gear</mat-label>
<mat-select [(ngModel)]="selectedRig" name="selectedRig"> <mat-select [(ngModel)]="selectedGear" name="selectedGear">
<mat-option value="8">Option 1</mat-option> <mat-option *ngFor="let gear of listOfGear" [value]="gear.id">
<mat-option value="9">Option 3</mat-option> {{gear.name}}
</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>

View File

@@ -6,6 +6,7 @@ import { JumpTypeResp } from "../../models/jumpType";
import { AircraftResp } from "../../models/aircraft"; import { AircraftResp } from "../../models/aircraft";
import { DropZoneResp } from "../../models/dropzone"; import { DropZoneResp } from "../../models/dropzone";
import { DateService } from "../../services/date.service"; import { DateService } from "../../services/date.service";
import { GearResp } from "../../models/gear";
@Component({ @Component({
selector: "app-new-jump", selector: "app-new-jump",
@@ -19,13 +20,14 @@ export class NewJumpComponent implements OnInit {
defaultDeployAltitude: number; defaultDeployAltitude: number;
countOfJumps: number; countOfJumps: number;
selectedDz: number; selectedDz: number;
selectedRig: number; selectedGear: number;
selectedAircraft: number; selectedAircraft: number;
selectedJumpType: number; selectedJumpType: number;
withCutaway: boolean; withCutaway: boolean;
listOfJumpType: Array<JumpTypeResp>; listOfJumpType: Array<JumpTypeResp>;
listOfAircraft: Array<AircraftResp>; listOfAircraft: Array<AircraftResp>;
listOfDropZone: Array<DropZoneResp>; listOfDropZone: Array<DropZoneResp>;
listOfGear: Array<GearResp>;
constructor( constructor(
private serviceComm: ServiceComm, private serviceComm: ServiceComm,
@@ -53,7 +55,7 @@ export class NewJumpComponent implements OnInit {
this.selectedJumpType, this.selectedJumpType,
this.selectedAircraft, this.selectedAircraft,
this.selectedDz, this.selectedDz,
this.selectedRig, this.selectedGear,
this.withCutaway, this.withCutaway,
this.beginDate, this.beginDate,
this.endDate, this.endDate,
@@ -68,6 +70,7 @@ export class NewJumpComponent implements OnInit {
this.listOfJumpType = data; this.listOfJumpType = data;
this.getListOfAircrafts(); this.getListOfAircrafts();
this.getListOfDropZones(); this.getListOfDropZones();
this.getListOfGears();
}); });
} }
@@ -83,10 +86,9 @@ export class NewJumpComponent implements OnInit {
}); });
} }
// private getListOfGears() { private getListOfGears() {
// this.serviceApiGet.getListOfGears() this.serviceApiGet.getListOfGears().subscribe(data => {
// .subscribe(data => { this.listOfGear = data;
// this.listOfGear = data; });
// }); }
// }
} }

View File

@@ -4,7 +4,7 @@ export class AircraftReq {
} }
public id: number; public id: number;
public name: number; public name: string;
} }
export class AircraftResp { export class AircraftResp {
@@ -13,5 +13,5 @@ export class AircraftResp {
} }
public id: number; public id: number;
public name: number; public name: string;
} }

View File

@@ -4,7 +4,7 @@ export class GearReq {
} }
public id: number; public id: number;
public name: number; public name: string;
} }
export class GearResp { export class GearResp {
@@ -13,5 +13,5 @@ export class GearResp {
} }
public id: number; public id: number;
public name: number; public name: string;
} }

View File

@@ -4,7 +4,7 @@ export class JumpTypeReq {
} }
public id: number; public id: number;
public name: number; public name: string;
} }
export class JumpTypeResp { export class JumpTypeResp {
@@ -13,5 +13,5 @@ export class JumpTypeResp {
} }
public id: number; public id: number;
public name: number; public name: string;
} }