Ajout des formulaires de création de
"Aircraft", "JumpType", "Gear" et "DZ".
This commit is contained in:
@@ -13,9 +13,10 @@ import { ServiceComm } from '../../services/service-comm.service';
|
||||
})
|
||||
export class ListOfAircraftsComponent implements OnInit {
|
||||
public displayedColumns: Array<string> = ['id', 'name'];
|
||||
public dataSourceTable;
|
||||
public dataSourceTable: MatTableDataSource<AircraftResp>;
|
||||
public resultsLength = 0;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
public showAddForm: boolean;
|
||||
|
||||
constructor(
|
||||
private serviceApi: ServiceApiGet,
|
||||
@@ -27,7 +28,7 @@ export class ListOfAircraftsComponent implements OnInit {
|
||||
this.getListOfAircrafts();
|
||||
}
|
||||
|
||||
getListOfAircrafts() {
|
||||
private getListOfAircrafts() {
|
||||
this.serviceApi.getListOfAircrafts().subscribe(data => {
|
||||
data.sort((a, b) => (b.name < a.name) ? 1 : -1);
|
||||
this.dataSourceTable = new MatTableDataSource<AircraftResp>(data);
|
||||
@@ -35,4 +36,8 @@ export class ListOfAircraftsComponent implements OnInit {
|
||||
this.resultsLength = data.length;
|
||||
});
|
||||
}
|
||||
|
||||
public add() {
|
||||
this.showAddForm = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user