Évolutin du formulaire d'ajout de saut pour

appeler l'API
This commit is contained in:
Sébastien André
2019-10-30 16:37:28 +01:00
parent e0ddb8e34b
commit cd95b2c9b1
10 changed files with 86 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { ServiceComm } from '../../services/serviceComm';
import { ServiceApiGet } from '../../services/serviceApiGet';
import { ServiceApiPost } from '../../services/serviceApiPost';
@Component({
@@ -16,11 +16,14 @@ export class NewJumpComponent implements OnInit {
defaultDeployAltitude: number;
countOfJumps: number;
selectedDz: number;
selectedRig: number;
selectedAircraft: number;
selectedJumpType: number;
withCutaway: boolean;
constructor(private serviceComm: ServiceComm) {
constructor(private serviceComm: ServiceComm,
private serviceApiGet: ServiceApiGet,
private serviceApiPost: ServiceApiPost) {
this.beginDate = new Date();
this.endDate = new Date();
@@ -34,14 +37,17 @@ export class NewJumpComponent implements OnInit {
}
onFormSubmit() {
console.log(this.selectedJumpType);
console.log(this.selectedAircraft);
console.log(this.selectedDz);
console.log(this.withCutaway);
console.log(this.beginDate);
console.log(this.endDate);
console.log(this.defaultExitAltitude);
console.log(this.defaultDeployAltitude);
console.log(this.countOfJumps);
this.serviceApiPost.AddJump(
this.selectedJumpType,
this.selectedAircraft,
this.selectedDz,
this.selectedRig,
this.withCutaway,
this.beginDate,
this.endDate,
this.defaultExitAltitude,
this.defaultDeployAltitude,
this.countOfJumps
);
}
}