Affichage en tableau pour les autres pages
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
body {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.hamburger__icon {
|
||||
position: relative;
|
||||
z-index: 50;
|
||||
height: 1rem;
|
||||
/*padding: 0.5rem 1.5rem;*/
|
||||
margin-right: 1rem;
|
||||
cursor: pointer;
|
||||
fill: #ffff;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<p>
|
||||
list-of-aircrafts works!
|
||||
</p>
|
||||
<table mat-table [dataSource]="dataSourceTable">
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef>ID</th>
|
||||
<td mat-cell *matCellDef="let element">{{element.id}}</td>
|
||||
</ng-container>
|
||||
|
||||
<table>
|
||||
<tr *ngFor="let aircraft of this.listOfAircrafts; index as i;">
|
||||
<td>{{ aircraft.id }}</td>
|
||||
<td>{{ aircraft.name }}</td>
|
||||
</tr>
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef>Name</th>
|
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons></mat-paginator>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
|
||||
import { AircraftResp } from '../../models/aircraft';
|
||||
import { ServiceApi } from '../../services/serviceApi';
|
||||
import { ServiceComm } from '../../services/serviceComm';
|
||||
@@ -10,6 +13,9 @@ import { ServiceComm } from '../../services/serviceComm';
|
||||
})
|
||||
export class ListOfAircraftsComponent implements OnInit {
|
||||
public listOfAircrafts: Array<AircraftResp> = new Array<AircraftResp>();
|
||||
public displayedColumns: Array<string> = ['id', 'name'];
|
||||
public dataSourceTable = new MatTableDataSource<AircraftResp>();
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) {
|
||||
}
|
||||
@@ -21,6 +27,10 @@ export class ListOfAircraftsComponent implements OnInit {
|
||||
|
||||
getListOfAircrafts() {
|
||||
this.serviceApi.getListOfAircrafts()
|
||||
.subscribe(data => this.listOfAircrafts = data);
|
||||
.subscribe(data => {
|
||||
this.listOfAircrafts = data;
|
||||
this.dataSourceTable = new MatTableDataSource<AircraftResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<p>
|
||||
list-of-dzs works!
|
||||
</p>
|
||||
|
||||
<table mat-table [dataSource]="dataSourceTable">
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef>ID</th>
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
<p>
|
||||
list-of-jump-types works!
|
||||
</p>
|
||||
<table mat-table [dataSource]="dataSourceTable">
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef>ID</th>
|
||||
<td mat-cell *matCellDef="let element">{{element.id}}</td>
|
||||
</ng-container>
|
||||
|
||||
<table>
|
||||
<tr *ngFor="let jumpType of this.listOfJumpTypes; index as i;">
|
||||
<td>{{ jumpType.id }}</td>
|
||||
<td>{{ jumpType.name }}</td>
|
||||
</tr>
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef>Name</th>
|
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons></mat-paginator>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
|
||||
import { JumpTypeResp } from '../../models/jumpType';
|
||||
import { ServiceApi } from '../../services/serviceApi';
|
||||
import { ServiceComm } from '../../services/serviceComm';
|
||||
@@ -10,6 +13,9 @@ import { ServiceComm } from '../../services/serviceComm';
|
||||
})
|
||||
export class ListOfJumpTypesComponent implements OnInit {
|
||||
public listOfJumpTypes: Array<JumpTypeResp> = new Array<JumpTypeResp>();
|
||||
public displayedColumns: Array<string> = ['id', 'name'];
|
||||
public dataSourceTable = new MatTableDataSource<JumpTypeResp>();
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) {
|
||||
}
|
||||
@@ -21,6 +27,10 @@ export class ListOfJumpTypesComponent implements OnInit {
|
||||
|
||||
getListOfJumpTypes() {
|
||||
this.serviceApi.getListOfJumpTypes()
|
||||
.subscribe(data => this.listOfJumpTypes = data);
|
||||
.subscribe(data => {
|
||||
this.listOfJumpTypes = data;
|
||||
this.dataSourceTable = new MatTableDataSource<JumpTypeResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<p>
|
||||
list-of-jumps works!
|
||||
</p>
|
||||
<table mat-table [dataSource]="dataSourceTable">
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef>ID</th>
|
||||
<td mat-cell *matCellDef="let element">{{element.id}}</td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<table>
|
||||
<tr *ngFor="let jump of this.listOfJumps | async; index as i;">
|
||||
<td>{{ jump.id }}</td>
|
||||
</tr>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons></mat-paginator>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
import { JumpResp } from '../../models/jump';
|
||||
import { ServiceApi } from '../../services/serviceApi';
|
||||
@@ -12,6 +15,9 @@ import { ServiceComm } from '../../services/serviceComm';
|
||||
})
|
||||
export class ListOfJumpsComponent implements OnInit {
|
||||
public listOfJumps: Observable<Array<JumpResp>>;
|
||||
public displayedColumns: Array<string> = ['id'];
|
||||
public dataSourceTable;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
|
||||
constructor(private serviceApi: ServiceApi, private serviceComm: ServiceComm) {
|
||||
}
|
||||
@@ -23,5 +29,9 @@ export class ListOfJumpsComponent implements OnInit {
|
||||
|
||||
getListOfJumps() {
|
||||
this.listOfJumps = this.serviceApi.getListOfJumps();
|
||||
this.listOfJumps.subscribe(data => {
|
||||
this.dataSourceTable = new MatTableDataSource<JumpResp>(data);
|
||||
this.dataSourceTable.paginator = this.paginator;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user