Affichage correctement de la liste des DZs

This commit is contained in:
Sébastien André
2019-10-10 11:19:57 +02:00
parent 3fa3275092
commit a29626cd51
2 changed files with 25 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
list-of-dzs works! list-of-dzs works!
</p> </p>
<table mat-table [dataSource]="dataSourceTable" class="mat-elevation-z8"> <table mat-table [dataSource]="dataSourceTable">
<ng-container matColumnDef="id"> <ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>ID</th> <th mat-header-cell *matHeaderCellDef>ID</th>
<td mat-cell *matCellDef="let element">{{element.id}}</td> <td mat-cell *matCellDef="let element">{{element.id}}</td>
@@ -10,7 +10,29 @@
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>Name</th> <th mat-header-cell *matHeaderCellDef>Name</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td> <td mat-cell *matCellDef="let element">{{element.name}} <a href='http://{{element.website}}'>ici</a></td>
</ng-container>
<ng-container matColumnDef="latitude">
<th mat-header-cell *matHeaderCellDef>Latitude</th>
<td mat-cell *matCellDef="let element">{{element.latitude}}</td>
</ng-container>
<ng-container matColumnDef="longitude">
<th mat-header-cell *matHeaderCellDef>Longitude</th>
<td mat-cell *matCellDef="let element">{{element.longitude}}</td>
</ng-container>
<ng-container matColumnDef="address">
<th mat-header-cell *matHeaderCellDef>Address</th>
<td mat-cell *matCellDef="let element"><span [innerHTML]="element.address"></span></td>
</ng-container>
<ng-container matColumnDef="email">
<th mat-header-cell *matHeaderCellDef>E-mail</th>
<td mat-cell *matCellDef="let element">{{element.email}}</td>
</ng-container>
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef>Type</th>
<td mat-cell *matCellDef="let element">{{element.type}}</td>
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

View File

@@ -15,7 +15,7 @@ import { ServiceComm } from '../../services/serviceComm';
export class ListOfDzsComponent implements OnInit { export class ListOfDzsComponent implements OnInit {
public listOfDropZones: Array<DropZoneResp> = new Array<DropZoneResp>(); public listOfDropZones: Array<DropZoneResp> = new Array<DropZoneResp>();
public displayedColumns: Array<string> = ['id', 'name']; public displayedColumns: Array<string> = ['id', 'name', 'latitude', 'longitude', 'address', 'email', 'type'];
public dataSourceTable = new MatTableDataSource<DropZoneResp>(); public dataSourceTable = new MatTableDataSource<DropZoneResp>();
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;