I wish to combine data from two different http posts into one object variable. I wish to run the combined results through ng-repeat to display a combined list on screen. Is there a way to do this in standard java script or do I have to bring in a library? I tried object.assign but received a null or undefined object error.
$http.post('Url1', {
param: @scope.myParam
}).success(function (data) {
$scope.myData1 = data;
});
$http.post('Url2', {
param: @scope.myParam
}).success(function (data) {
$scope.myData2 = data;
});
$scope.myData = Object.assign($scope.myData1, $scope.myData2);