I'm attempting to modify a section of an AngularJS ng-repeat that contains a nested ng-repeat, as shown in the following example:
<div ng-repeat="product in products">
<div ng-repeat="color in product.colors"></div>
</div>
The data is sourced from a combined array.
Array colors
Array products
and is then consolidated into a single array structured like this:
{
product:"car",
brand:"volvo",
colors: {
front: "red",
roof: "yellow",
};
How can I update the $scope.colors
so that the change is reflected in the ng-repeat
(adding another color) without having to update the entire $scope.products
, which would necessitate rebuilding everything?