Full crud with the delete

This commit is contained in:
2023-01-18 19:53:58 +01:00
parent ddb3706e44
commit aa4399ea20
3 changed files with 25 additions and 7 deletions

View File

@@ -2,8 +2,11 @@
<form [formGroup]="form" (ngSubmit)="onSubmit(model)">
<span class="col col-form-label" *ngIf="loading$ | async">Loading...</span>
<formly-form [form]="form" [fields]="fields" [model]="model"></formly-form>
<button type="submit" class="btn btn-default">
{{resource_id === null ? "Create" : "Update"}}
<button color="primary" type="submit" class="btn btn-default">
{{ this.isCreateForm() ? "Create" : "Update" }}
</button>
<button *ngIf="!this.isCreateForm()" (click)="onDelete()" color="danger" type="" class="btn btn-default">
Delete
</button>
</form>
</div>