I have a jagged data from a MongoDb collection like this:
$scope.data = [ { "fieldA": "value-a", "fieldB": "value-b" }, { "fieldA": "value-a", "fieldB": "value-b", "fieldC": "value-c" }]
Using ...
angular.forEach(data, function(item){ $scope.colHeaders.push(item. ?????????) });
How can I get the field names as column headers and avoid duplication?