You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
#2618 and various other posts have explored and explained why Angular current does not support the copying of objects with circular references. I believe this is an unnecessary restriction and so would like to make a proposal.
The proposal is simple. Modify angular.copy such that:
functioncopy(source,destination){if(isWindow(source)||isScope(source)){throwngMinErr('cpws',"Can't copy! Making copies of Window or Scope instances is not supported.");}// ***** ADD THESE LINES ****if(source&&(source.$clone!=null)){returnsource.$clone(destination);}// ....
(The choice of $clone as the function name is intentional)
This then allows the developer to explicitly add support on objects that contain circular references.