I'm trying to load data in one ui grid table from two json files, but there are data only from one file.
I've prepared two arrays for the both json files.
$scope.sourceOne = [];
$scope.sourceTwo = [];
Then I've loaded data with $http
service
$http.get('SourceOne.json').success(function (data) {
data.forEach( function( row, index ) {
$scope.sourceOne.push(data);
});
$scope.gridOptions.data = data;
console.log('data from SourceOne.json', data);
});
$http.get('SourceTwo.json').success(function (data) {
data.forEach( function( row, index ) {
$scope.sourceTwo.push(data);
});
$scope.gridOptions.data = data;
console.log('data from SourceTwo.json', data);
});
and at the I've tried to concatenate these two arrays and show as a result in the grid.
$scope.myConcatenatedData = $scope.sourceOne.concat($scope.sourceTwo);
Pls take a look at the plunker