Début de l'appli Front

This commit is contained in:
Sébastien André
2019-09-30 16:07:08 +02:00
parent c6c2777c22
commit bbb5c59794
4 changed files with 60 additions and 3 deletions

View File

@@ -1,15 +1,27 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Injectable } from '@angular/core';
import { DropZoneResp } from '../../models/dropzone';
import { ServiceApi } from '../../services/serviceApi';
@Component({
selector: 'app-list-of-dzs',
templateUrl: './list-of-dzs.component.html',
styleUrls: ['./list-of-dzs.component.css']
})
export class ListOfDzsComponent implements OnInit {
constructor() { }
export class ListOfDzsComponent implements OnInit {
public listOfDropZones: Array<DropZoneResp>;
constructor(private serviceApi: ServiceApi) { }
ngOnInit() {
}
getListOfDropZones() {
this.serviceApi.getListOfDropZones()
.subscribe((data: DropZoneResp) => this.listOfDropZones = {
heroesUrl: data['heroesUrl'],
textfile: data['textfile']
});
}
}

View File

@@ -0,0 +1,10 @@
export class DropZoneResp {
public Id: number;
public Latitude: string;
public Longitude: string;
public Name: string;
public Address: string;
public Website: string;
public Email: string;
public Type: Array<string>;
}

View File

@@ -0,0 +1,23 @@
export class JumpReq {
public Id: number;
public JumpTypeId: number;
public AircraftId: number;
public DropZoneId: number;
public GearId: number;
public ExitAltitude: number;
public DeployAltitude: number;
public WithCutaway: boolean;
public Notes: string;
}
export class JumpResp {
public Id: number;
public JumpTypeId: number;
public AircraftId: number;
public DropZoneId: number;
public GearId: number;
public ExitAltitude: number;
public DeployAltitude: number;
public WithCutaway: boolean;
public Notes: string;
}

View File

@@ -0,0 +1,12 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { DropZoneResp } from '../models/dropzone';
@Injectable()
export class ServiceApi {
constructor(private http: HttpClient) { }
public getListOfDropZones() {
return this.http.get<DropZoneResp>('http://localhost:1234/api/DropZone');
}
}