|
|
|
@ -1,4 +1,7 @@
|
|
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
import { NzModalRef } from 'ng-zorro-antd/modal'; |
|
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-addmenu', |
|
|
|
@ -7,9 +10,18 @@ import { Component, OnInit } from '@angular/core';
|
|
|
|
|
}) |
|
|
|
|
export class AddmenuComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor() { } |
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
name: [null, [Validators.required]], |
|
|
|
|
// code: [null, [Validators.required]],
|
|
|
|
|
isGasStation: [false] |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
destroyModal(): void { |
|
|
|
|
this.modal.destroy({ data: 'this the result data' }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |