Currently, I am working on developing an application that utilizes a Parent-Child hierarchy by incorporating AngularJs to connect the information retrieved from the RESTFUL web service with the user interface.
To demonstrate, here is an example of the JSON structure that the web service might provide:
{"id":0,"name":"Parent One","listOfChildren":[{"id":0,"name":"Child 1","childType":"CHILD1"},{"id":1,"name":"Child 2","childType":"CHILD1"}]}
While I understand how to store this data in an array and present it in a table through Angular's ng-repeat feature, I am faced with a challenge. With potentially hundreds or even thousands of children for each parent, and countless parents overall, managing such a massive array becomes daunting.
Additionally, updating a parent with a new child requires searching the entire array to locate the specific parent before inserting the new child, resulting in significant inefficiency.
Therefore, my inquiry revolves around finding a more streamlined approach to handle this scenario without relying on a single extensive array.
I appreciate any guidance or assistance provided. Thank you.