New view of list
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AircraftResp } from '../../models/aircraft';
|
||||
import { ServiceApi } from '../../services/serviceApi';
|
||||
|
||||
@Component({
|
||||
selector: 'app-list-of-aircrafts',
|
||||
templateUrl: './list-of-aircrafts.component.html',
|
||||
styleUrls: ['./list-of-aircrafts.component.css']
|
||||
})
|
||||
export class ListOfAircraftsComponent implements OnInit {
|
||||
public listOfAircrafts: Array<AircraftResp> = new Array<AircraftResp>();
|
||||
|
||||
constructor(private serviceApi: ServiceApi) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getListOfAircrafts();
|
||||
}
|
||||
|
||||
getListOfAircrafts() {
|
||||
this.serviceApi.getListOfAircrafts()
|
||||
.subscribe(data => this.listOfAircrafts = data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user