added profil section and fix error in stock-table.html

This commit is contained in:
2025-11-13 23:37:49 +01:00
parent ef5aaf67bd
commit 9c8a41286a
9 changed files with 138 additions and 38 deletions

View File

@@ -0,0 +1,42 @@
import { Component } from '@angular/core';
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms";
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";
@Component({
selector: 'app-profil-form',
imports: [
FormsModule,
NzColDirective,
NzFlexDirective,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzInputDirective,
ReactiveFormsModule
],
templateUrl: './profil-form.html',
styleUrl: './profil-form.css',
})
export class ProfilForm {
profilForm: FormGroup = new FormGroup({
newName: new FormControl<string>(null, [Validators.required]),
newEmail: new FormControl<string>(null, [Validators.required]),
newFonction: new FormControl<string>(null, [Validators.required]),
newPassword: new FormControl<string>(null, [Validators.required])
})
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.profilForm.invalid) return;
// Pour obtenir la valeur du formulaire
console.log(this.profilForm.getRawValue())
// Pour vider le formulaire
this.profilForm.reset()
}
}