Issue
How to refresh the formArray in material table when we make new api call (Filtered data). If I click Filter data
button, it should refresh and load new data from api. Currently its not refreshing material table and its adding new data into form array. How I can fix this?
Here is code: Demo
Solution
Remove existing formArray by calling clear method on formArray. Then create a new FormArray then update the data source with new controls.
onsubmit() {
this.productArray.clear();
this.formBuilder(this.sample2);
this.tableDetails.data = this.productArray.controls;
}
Answered By - Chellappan வ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.