Ajout d'un système de cache des
requêtes HTTP
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ServiceComm } from '../../services/serviceComm';
|
||||
import { ServiceApiGet } from '../../services/serviceApiGet';
|
||||
import { ServiceApiPost } from '../../services/serviceApiPost';
|
||||
import { JumpTypeResp } from '../../models/jumpType';
|
||||
import { AircraftResp } from '../../models/aircraft';
|
||||
import { DropZoneResp } from '../../models/dropzone';
|
||||
import { DateService } from '../../services/dateService';
|
||||
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ServiceComm } from "../../services/service-comm.service";
|
||||
import { ServiceApiGet } from "../../services/service-api-get.service";
|
||||
import { ServiceApiPost } from "../../services/service-api-post.service";
|
||||
import { JumpTypeResp } from "../../models/jumpType";
|
||||
import { AircraftResp } from "../../models/aircraft";
|
||||
import { DropZoneResp } from "../../models/dropzone";
|
||||
import { DateService } from "../../services/date.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-jump',
|
||||
templateUrl: './new-jump.component.html',
|
||||
styleUrls: ['./new-jump.component.css']
|
||||
selector: "app-new-jump",
|
||||
templateUrl: "./new-jump.component.html",
|
||||
styleUrls: ["./new-jump.component.css"]
|
||||
})
|
||||
export class NewJumpComponent implements OnInit {
|
||||
beginDate: Date;
|
||||
@@ -28,14 +27,15 @@ export class NewJumpComponent implements OnInit {
|
||||
listOfAircraft: Array<AircraftResp>;
|
||||
listOfDropZone: Array<DropZoneResp>;
|
||||
|
||||
constructor(private serviceComm: ServiceComm,
|
||||
constructor(
|
||||
private serviceComm: ServiceComm,
|
||||
private serviceApiGet: ServiceApiGet,
|
||||
private serviceApiPost: ServiceApiPost,
|
||||
private dateService: DateService) {
|
||||
}
|
||||
private dateService: DateService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.serviceComm.updatedComponentTitle('Add a new jump');
|
||||
this.serviceComm.updatedComponentTitle("Add a new jump");
|
||||
|
||||
this.endDate = new Date();
|
||||
|
||||
@@ -64,26 +64,23 @@ export class NewJumpComponent implements OnInit {
|
||||
}
|
||||
|
||||
private getListOfJumpTypes() {
|
||||
this.serviceApiGet.getListOfJumpTypes()
|
||||
.subscribe(data => {
|
||||
this.listOfJumpType = data;
|
||||
this.getListOfAircrafts();
|
||||
this.getListOfDropZones();
|
||||
});
|
||||
this.serviceApiGet.getListOfJumpTypes().subscribe(data => {
|
||||
this.listOfJumpType = data;
|
||||
this.getListOfAircrafts();
|
||||
this.getListOfDropZones();
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfAircrafts() {
|
||||
this.serviceApiGet.getListOfAircrafts()
|
||||
.subscribe(data => {
|
||||
this.listOfAircraft = data;
|
||||
});
|
||||
this.serviceApiGet.getListOfAircrafts().subscribe(data => {
|
||||
this.listOfAircraft = data;
|
||||
});
|
||||
}
|
||||
|
||||
private getListOfDropZones() {
|
||||
this.serviceApiGet.getListOfDropZones()
|
||||
.subscribe(data => {
|
||||
this.listOfDropZone = data;
|
||||
});
|
||||
this.serviceApiGet.getListOfDropZones().subscribe(data => {
|
||||
this.listOfDropZone = data;
|
||||
});
|
||||
}
|
||||
|
||||
// private getListOfGears() {
|
||||
|
||||
Reference in New Issue
Block a user