update recipe detail
This commit is contained in:
parent
d52cad09fd
commit
9279ef0247
11 changed files with 58 additions and 123 deletions
|
|
@ -68,7 +68,6 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
isUse: false,
|
||||
isShow: false,
|
||||
disable: false,
|
||||
recipeListData: this._formBuilder.array([]),
|
||||
});
|
||||
|
||||
ngOnInit() {
|
||||
|
|
@ -83,6 +82,8 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
this.recipeOriginalDetail = { ...this.recipeDetailForm.getRawValue() };
|
||||
});
|
||||
|
||||
this.recipeDetailForm.valueChanges.subscribe(this.onRecipeDetailFormChange);
|
||||
|
||||
// snap recipe detail form value
|
||||
|
||||
this.actionRecord.registerOnAddAction((currAction, allAction) => {
|
||||
|
|
@ -144,10 +145,14 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
get isValueChanged() {
|
||||
return !isEqual(
|
||||
this.recipeOriginalDetail,
|
||||
this.recipeDetailForm.getRawValue()
|
||||
);
|
||||
isValueChanged: boolean = false;
|
||||
|
||||
onRecipeDetailFormChange(recipeDetail: typeof this.recipeDetailForm.value) {
|
||||
console.log('Recipe Detail Form Changed', recipeDetail);
|
||||
}
|
||||
|
||||
onRecipeListFormChange(isValueChanged: boolean) {
|
||||
console.log('Recipe List Form Changed', isValueChanged);
|
||||
this.isValueChanged ||= isValueChanged;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue