Files
SkydiveLogs/Front/skydivelogs-app/src/app/list-of-dzs/list-of-dzs.component.ts
2019-10-09 17:13:53 +02:00

30 lines
829 B
TypeScript

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