updated supplier page
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Component, input} from '@angular/core';
|
||||
import {Component, effect, input} 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";
|
||||
@@ -31,6 +31,19 @@ export class SupplierForm {
|
||||
deliveryDelay: new FormControl<string>(null, [Validators.required]),
|
||||
|
||||
})
|
||||
supplier= input.required<GetSupplierDto>()
|
||||
|
||||
supplier= input.required<GetSupplierDto | null>();
|
||||
constructor() {
|
||||
effect(() => {
|
||||
if (this.supplier()) {
|
||||
this.supplierForm.patchValue({
|
||||
name: this.supplier().name,
|
||||
email: this.supplier().email,
|
||||
phone: this.supplier().phone,
|
||||
address: this.supplier().address,
|
||||
city: this.supplier().city,
|
||||
deliveryDelay: this.supplier().deliveryDelay,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user