Début de l'appli Front
This commit is contained in:
@@ -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']
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
10
Front/skydivelogs-app/src/models/dropzone.ts
Normal file
10
Front/skydivelogs-app/src/models/dropzone.ts
Normal 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>;
|
||||
}
|
||||
23
Front/skydivelogs-app/src/models/jump.ts
Normal file
23
Front/skydivelogs-app/src/models/jump.ts
Normal 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;
|
||||
}
|
||||
12
Front/skydivelogs-app/src/services/serviceApi.ts
Normal file
12
Front/skydivelogs-app/src/services/serviceApi.ts
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user