My JSON structure is as follows:
I am attempting to group by NodeGroup using the underscore library.
vm.populatedNodeGroups = _($scope.nodes).groupBy(function (o) {
return o.NodeGroup.Name;
});
Within vm.populatedNodeGroups
, I receive two keys ("Are One Routers" and "Are Two Switches") with two arrays each.
What I want to achieve is two Node Group Objects with two arrays each.
Any suggestions on how to accomplish this?