adding a create button in lists

This commit is contained in:
2023-02-07 18:27:17 +01:00
parent a35e86ab83
commit 1e4ee57b61
2 changed files with 24 additions and 15 deletions

View File

@@ -1,4 +1,8 @@
<form>
<button class="btn btn-success btn-lg float-end" type="button" (click)="onCreate()">
Create {{ this.schema }}
</button>
<div class="mb-3 row">
<label for="table-complete-search" class="col-xs-3 col-sm-auto col-form-label">Full text search:</label>
<div class="col-xs-3 col-sm-auto">
@@ -12,7 +16,7 @@
</div>
<span class="col col-form-label" *ngIf="loading$ | async">Loading...</span>
</div>
<div class="table-responsive-md">
<table class="table table-striped">
<thead>
<tr>
@@ -27,6 +31,7 @@
</tr>
</tbody>
</table>
</div>
<div class="d-flex justify-content-between p-2">
<ngb-pagination [collectionSize]="(total$ | async)!" [(page)]="page" [pageSize]="pageSize">

View File

@@ -103,6 +103,10 @@ export class ListComponent implements OnInit {
this.router.navigate([`../${id}`], {relativeTo: this.route});
}
onCreate() {
this.router.navigate([`../new`], {relativeTo: this.route});
}
get listData$() {
return this._listData$.asObservable();
}