adding a create button in lists
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user