new tag v3.1.0
Fix: Company references left after the field was removed
This commit is contained in:
@ -44,18 +44,6 @@
|
||||
<input matInput placeholder="Pax" type="number" formControlName="pax" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Company</mat-label>
|
||||
<input matInput placeholder="Company" formControlName="company" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
|
||||
@ -28,7 +28,6 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
createForm() {
|
||||
this.form = this.fb.group({
|
||||
company: null,
|
||||
name: [null, Validators.required],
|
||||
phone: [null, Validators.required],
|
||||
pax: ['0', Validators.required],
|
||||
@ -51,7 +50,6 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit {
|
||||
showItem(item: GuestBook) {
|
||||
this.item = item;
|
||||
this.form.setValue({
|
||||
company: item.company,
|
||||
name: item.name,
|
||||
phone: item.phone,
|
||||
pax: `${item.pax}`,
|
||||
@ -73,7 +71,6 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit {
|
||||
|
||||
getItem(): GuestBook {
|
||||
const formModel = this.form.value;
|
||||
this.item.company = formModel.company;
|
||||
this.item.name = formModel.name;
|
||||
this.item.phone = formModel.phone;
|
||||
this.item.pax = parseInt(formModel.pax, 10);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
export class GuestBook {
|
||||
id: string;
|
||||
serial: number;
|
||||
company: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
pax: number;
|
||||
|
||||
Reference in New Issue
Block a user