indexData and indexEditData serve as the observables within my application. The purpose of indexData is to store a json object that is used to populate a table. Editing of table rows is facilitated by selecting individual rows, triggering the transfer of the selected row's json into indexEditData. This allows for modifications to be made within indexEditData without affecting the original values in indexData.
However, I am facing the challenge of preventing changes made in indexEditData from reflecting back onto indexData while editing.
private INDEX_DATA: any[] = [];
private indexDataSource = new BehaviorSubject(this.INDEX_DATA);
indexData = this.indexDataSource.asObservable();
private INDEX_EDIT_DATA: any[] = []; // For Grid in edit view
private indexDataEditSource = new BehaviorSubject(this.INDEX_EDIT_DATA);
indexEditData = this.indexDataEditSource.asObservable();