I wonder if there is away to avoid copying references to objects when you need to create a simple object which has an array of embedded objects.The situation is as follow: I
I personally use this:
function copyObjToObj(source, destination) { if(!angular.equals(source,destination)){ if (!!destination) angular.copy(source, destination); else destination = angular.copy(source); } return destination; } var destination = copyObjToObj(sourceObj, destination);