Layer detail refactor

This commit is contained in:
Michał Zieliński
2023-08-22 21:13:47 +02:00
parent dd64b34fa3
commit d019189ec1
6 changed files with 33 additions and 44 deletions

View File

@@ -12,10 +12,10 @@
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef>Type</th>
<td mat-cell *matCellDef="let element">{{element.type}}</td>
<td mat-cell *matCellDef="let element">{{LayerType[element.type]}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns, sticky: true"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [routerLink]="['Detail/', row.id]"></tr>
</table>
</div>

View File

@@ -2,7 +2,7 @@ import { HttpClient } from '@angular/common/http';
import { Component, HostListener, OnInit } from '@angular/core';
import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table';
import { Layer } from 'src/app/models/layer.model';
import { Layer, LayerType } from 'src/app/models/layer.model';
import { MatInputModule } from '@angular/material/input';
import { MatFormFieldModule } from '@angular/material/form-field';
import { RouterLink } from '@angular/router';
@@ -26,6 +26,7 @@ import { NgFor } from '@angular/common';
export class LayersListComponent implements OnInit {
displayedColumns = ['number', 'name', 'type'];
dataSource!: Layer[];
LayerType = LayerType;
start = 0;
limit = 50;