update searchbar on supplier and stock

This commit is contained in:
Enzo
2025-12-11 17:14:23 +01:00
parent 25de3eae4b
commit 8d98a01c22
11 changed files with 62 additions and 21 deletions
+6 -8
View File
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, output } from '@angular/core';
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
@@ -24,14 +24,12 @@ export class Search {
searchValue: new FormControl<string>(null)
})
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.searchForm.invalid) return;
searchEvent = output<string>();
// Pour obtenir la valeur du formulaire
console.log(this.searchForm.getRawValue())
OnSearch(): void {
const raw = this.searchForm.controls['searchValue'].value ?? '';
const value = String(raw).trim();
this.searchEvent.emit(value);
// Pour vider le formulaire
this.searchForm.reset()
}
}