Début d'ajout de Amgular-Material

This commit is contained in:
Sébastien André
2019-10-09 18:27:56 +02:00
parent ada8b6b72d
commit 85511fb0de
3 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
table {
width: 100%;
}

View File

@@ -2,9 +2,22 @@
list-of-dzs works! list-of-dzs works!
</p> </p>
<table> <!-- <table>
<tr *ngFor="let dropZone of this.listOfDropZones; index as i;"> <tr *ngFor="let dropZone of this.listOfDropZones; index as i;">
<td>{{ dropZone.id }}</td> <td>{{ dropZone.id }}</td>
<td>{{ dropZone.name }}</td> <td>{{ dropZone.name }}</td>
</tr> </tr>
</table> -->
<table mat-table [dataSource]="listOfDropZones">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef> ID </th>
<td mat-cell *matCellDef="let element"> {{element.id}} </td>
</ng-container>
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
</ng-container>
</table> </table>
<mat-paginator [pageSizeOptions]="[5, 10, 20]" showFirstLastButtons></mat-paginator>

View File

@@ -1,4 +1,7 @@
import { Component, OnInit, Injectable } from '@angular/core'; import { Component, OnInit, Injectable } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { DropZoneResp } from '../../models/dropzone'; import { DropZoneResp } from '../../models/dropzone';
import { ServiceApi } from '../../services/serviceApi'; import { ServiceApi } from '../../services/serviceApi';
import { ServiceComm } from '../../services/serviceComm'; import { ServiceComm } from '../../services/serviceComm';