feat: implement add product functionality; create add-product component with form validation and styling

This commit is contained in:
Vincent Guillet
2025-11-05 16:44:42 +01:00
parent 1a918a7863
commit b84a829a82
12 changed files with 1109 additions and 305 deletions

View File

@@ -1,8 +1,8 @@
<form [formGroup]="form" (ngSubmit)="save()">
<h2 mat-dialog-title>{{ data?.title ?? 'Edit' }}</h2>
<h2 mat-dialog-title>{{ data.title ?? 'Edit' }}</h2>
<mat-dialog-content>
@for (f of (fields ?? []); track $index) {
@for (f of fields; track $index) {
@if (f.type === 'checkbox') {
<mat-checkbox [formControlName]="f.key">
@@ -12,7 +12,7 @@
<mat-form-field style="width:100%; margin-top:8px;">
<mat-label>{{ f.label }}</mat-label>
<mat-select [formControlName]="f.key">
<mat-select [formControlName]="f.key" [compareWith]="getCompareFn(f)">
@let opts = (f.options ?? (f.options$ | async) ?? []);
@for (opt of opts; track $index) {