I have encountered a challenge with a tree structure implemented in Javascript which has circular references. The objects in the structure contain an array of children, but these children also need to reference their parent for deletion purposes.
To monitor changes in the tree structure efficiently, I am using an angular deep watch. This approach helps avoid watching every individual node of the tree. However, the presence of circular references is causing complications with the Angular $watch mechanism. Resolving the parent/child referencing issue seems necessary based on certain design requirements of my application.
One solution I am considering involves storing the link to the parent as a prototype. My question is: does Angular deep $watch inspect the prototype members of a custom object? Is there a configuration setting available to address this issue?
Any insights or suggestions would be appreciated. Thank you.