The problem is not
this.backupPersons = JSON.parse(JSON.stringify(this.persons));
Its that angular keeps calling the backup method so that when I come to use it, the backup has been overwritten to reflect the the changes to the original making it useless unless I can limit how many calls angular makes!
I discovered this when I modified the method responsible as follows:
private makeBackup()
{
this.deletedPersons = new Array<PersonMasterBase>();
this.backupPersons = new Array<PersonMasterBase>();
this.backupPersons = JSON.parse(JSON.stringify(this.persons));
console.log(this.persons[1].p_Address1);
console.log(this.backupPersons[1].p_Address1);
this.backupPersons[1].p_Address1 = "New Value";
console.log(this.persons[1].p_Address1);
console.log(this.backupPersons[1].p_Address1);
}
The logged information showed that firstly, the stringify was doing its job, and more importantly that the module call was being repeated many many times, each one making a fresh backup so that time I needed the backup it had the same information as the original. The the problem as reported was completely mis leading.