Ajout des formulaires de création de

"Aircraft", "JumpType", "Gear" et "DZ".
This commit is contained in:
Sébastien André
2019-11-28 16:44:53 +01:00
parent 54f5398af1
commit b1613ab15b
26 changed files with 212 additions and 7 deletions

View File

@@ -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;
}
}