I have two arrays of objects which I need to combine in a specific way. You can view the arrays here: https://plnkr.co/edit/RQs9WWs1hcxmuKGIgEhM?p=preview
My goal is to merge these arrays so that any elements missing from one array are added to create a complete set. For example, if an element exists only in the first array, it should be included in the final combined array.
Here is the desired output:
[{"car":"A","miles":100},{"car":"B","miles":100},{"car":"C","miles":100,"sold":"Y"}]
[{"car":"B","miles":100,"sold":"Y"},{"car":"C","miles":100,"sold":"Y"}]
[{"car":"A","miles":100},{"car":"B","miles":100,"sold":"Y"},{"car":"C","miles":100,"sold":"Y"}]
It seems Angular's merge method will not work for this scenario because the objects do not match up perfectly. I am considering looping over the arrays and creating a common list by generating unique identifiers for each object to assist in matching them.