I am currently working on displaying an array using ng-grid and I am encountering some issues. Here is the link to the code: http://plnkr.co/edit/G33IlPCNAdh1jmNTtVNO?p=preview
It seems that ng-grid requires a JSON object instead of an array for the field portion. I have noticed that by uncommenting and replacing instances of $scope.test with $scope.test2 in the code provided in the plunkr, the data is displayed correctly. However, I am currently facing issues with undefined messages. How can I programmatically change $scope.test to match the format of $scope.test2 for ng-grid?
In essence, I would like to transform the array $scope.test to something like $scope.test2 specifically for ng-grid. Is there a way to achieve this? Any assistance on this matter would be highly appreciated.
Edit:
Essentially, I am looking to convert:
$scope.test = ['blah', 'blah2'];
to a format like:
$scope.test2 = [{name:['blah', 'blah2']}]; //name can be changed to anything
//name just has to specify the name of the array inside this object.
Is this feasible?