Okay, let met explain. I am getting a obsersable from AngularFire Database, and here is what I pretend to do: - get 2 static copies of the obsersable response - show 1 static copy - allow user to modify this static copy and not save it - when user decides too cancel the changes, i simply get the copy number 2 and set it to copy number 1.
getting obsersable:
this.afoDatabase.object("usuarios/"+this.userKey+"/pacientes/"+this.pacienteKey).map(res=> {
this.model = res;
this.model2 = res;
}).first().toPromise();
when the users decides to cancel the changes, here is what i am doing:
this.model = this.model2;
// this.model is the copy number 1 and this.model2 is the 'unchanged' copy number 2
but when i do it, the copy number 2, even that i never showed or changed it, is exactly equal to copy number 1;