|
|
@ -1,5 +1,6 @@ |
|
|
|
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from "@angular/core"; |
|
|
|
import { FormArray, FormBuilder, FormGroup } from "@angular/forms"; |
|
|
|
import { ActivatedRoute, Router } from "@angular/router"; |
|
|
|
import { OrgDTO } from "@cdk/dtos"; |
|
|
|
import { ApiService } from "@cdk/services"; |
|
|
|
import { OptionItemInterface } from "@cdk/types"; |
|
|
@ -14,7 +15,13 @@ import { Subject, debounceTime, distinctUntilChanged, filter, finalize, switchMa |
|
|
|
styleUrls: ["./ingredient-form-basic.component.less"], |
|
|
|
}) |
|
|
|
export class IngredientFormBasicComponent implements OnChanges { |
|
|
|
constructor(private fb: FormBuilder, private msg: NzMessageService, private api: ApiService) {} |
|
|
|
constructor( |
|
|
|
private fb: FormBuilder, |
|
|
|
private msg: NzMessageService, |
|
|
|
private api: ApiService, |
|
|
|
private router: Router, |
|
|
|
private route: ActivatedRoute |
|
|
|
) {} |
|
|
|
|
|
|
|
@Input() menu: any | null; |
|
|
|
|
|
|
@ -170,6 +177,11 @@ export class IngredientFormBasicComponent implements OnChanges { |
|
|
|
) |
|
|
|
.subscribe((res) => { |
|
|
|
this.msg.success(res.desc); |
|
|
|
this.router.navigate([], { |
|
|
|
relativeTo: this.route, |
|
|
|
queryParams: { newId: res.body }, |
|
|
|
queryParamsHandling: "merge", |
|
|
|
}); |
|
|
|
this.onSave.emit({ |
|
|
|
...this.formGroup.value, |
|
|
|
meals: this.meals, |
|
|
|