This is my first project on Angular and I have done as much as I could and I will try to finish it myself but I feel like that I require help.
A brief description of th
If you want to merge form data from both objects you can do:
finalData = {};
saveClause(form: NgForm) {
this.show1 = true;
Object.assign(this.finalData, form.value);
}
addFilter(filter: NgForm) {
Object.assign(this.finalData, filter.value);
filter.reset();
}
Now depending on your use case you can decide when to post this data to the backend.
EDIT:
Since you want to merge into a single object use:
finalPostArray = [];
mergedObj = {};
saveClause(form: NgForm) {
...
Object.assign(this.mergedObj, form.value);
this.finalPostArray.push(this.mergedObj);
...
}
addFilter(filter: NgForm) {
Object.assign(this.mergedObj, filter.value);
filter.reset();
}
Working stackblitz