added deliverer page with deliverer-form and deliverer-table

This commit is contained in:
2025-11-15 15:12:53 +01:00
parent 4037117ad3
commit d43f46b906
9 changed files with 502 additions and 3 deletions

View File

@@ -0,0 +1,11 @@
<form nz-form nzLayout="horizontal" [formGroup]="delivererForm" (ngSubmit)="submitForm()">
<nz-form-item nz-flex>
<nz-form-label nzSpan="9" nzRequired>
Transporteur
</nz-form-label>
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<input nz-input placeholder="Chronopost" formControlName="transporter">
</nz-form-control>
</nz-form-item>
</form>

View File

@@ -0,0 +1,38 @@
import { Component } from '@angular/core';
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
@Component({
selector: 'app-deliverer-form',
imports: [
NzColDirective,
NzFlexDirective,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './deliverer-form.html',
styleUrl: './deliverer-form.css',
})
export class DelivererForm {
delivererForm: FormGroup = new FormGroup({
transporter: new FormControl<string>(null, [Validators.required])
})
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.delivererForm.invalid) return;
// Pour obtenir la valeur du formulaire
console.log(this.delivererForm.getRawValue())
// Pour vider le formulaire
this.delivererForm.reset()
}
}