update searchbar on supplier and stock
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user