Skip to content

Commit 96c3712

Browse files
committed
fix(public forms): show loading until form is ready to avoid errors
1 parent ed5ad89 commit 96c3712

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

src/app/features/public-form/public-form.component.html

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,33 @@
33
<mat-card-title>{{ formConfig?.title }}</mat-card-title>
44
<mat-card-subtitle>{{ formConfig?.description }}</mat-card-subtitle>
55
</mat-card-header>
6-
<mat-card-content>
7-
<app-entity-form
8-
[entity]="entity"
9-
[fieldGroups]="fieldGroups"
10-
[form]="form"
11-
[gridLayout]="false"
12-
></app-entity-form>
13-
</mat-card-content>
14-
<mat-card-footer>
15-
<button
16-
mat-raised-button
17-
(click)="submit()"
18-
color="accent"
19-
i18n="Submit form button"
20-
>
21-
Submit Form
22-
</button>
23-
<button mat-stroked-button (click)="reset()" i18n="Reset form button">
24-
Reset
25-
</button>
26-
</mat-card-footer>
6+
7+
@if (formConfig && form) {
8+
<mat-card-content>
9+
<app-entity-form
10+
[entity]="entity"
11+
[fieldGroups]="fieldGroups"
12+
[form]="form"
13+
[gridLayout]="false"
14+
></app-entity-form>
15+
</mat-card-content>
16+
17+
<mat-card-footer>
18+
<button
19+
mat-raised-button
20+
(click)="submit()"
21+
color="accent"
22+
i18n="Submit form button"
23+
>
24+
Submit Form
25+
</button>
26+
<button mat-stroked-button (click)="reset()" i18n="Reset form button">
27+
Reset
28+
</button>
29+
</mat-card-footer>
30+
} @else {
31+
<mat-card-content>
32+
<p i18n>Loading form ...</p>
33+
</mat-card-content>
34+
}
2735
</mat-card>

0 commit comments

Comments
 (0)