Here is the current code implementation:
$http.get("http://localhost/app/api/Suppliers").success(function(response) {
$scope.dataSource = response;
console.log($scope.dataSource);
$scope.safeApply(function() {
$scope.settings.columns[3] = $scope.dataSource;
});
});
$scope.settings = {
colHeaders: ["Code", "Comments"],
contextMenu : ["row_above","row_below","remove_row"],
colWidths: [100, 100],
columns : [
{ type: 'dropdown',
source: ['Not Started', 'In Progress', 'Completed']
},
{},
{},
{ type: 'dropdown',
source: $scope.dataSource,
}
]
};
The issue at hand is that $scope.dataSource
is currently undefined, resulting in no data being displayed. How can this be resolved?
UPDATE: While the $http call successfully retrieves the data, the problem lies in the fact that when calling source: $scope.dataSource within the settings, it remains undefined.