I have an object like
var person = {'id':null, 'name':'John Doe'}
After inserting the object value into the database, I will get another object from the server:
var personInDB = {'id':1234, 'name':'John Doe'}
I have used angular.merge
to use updated the value of person
with that of personInDB
.
But, I want to empty person
object before applying angular.merge
, so that I only get the values in database. I don't want to assign new empty object to person as that will break data-binding in angular.