I am just trying to get a basic Angular UI ng-grid working. We have data coming from sql server data sources with columns with spaces and ngGrid is not recognising those column names. Is there any way to get the ngGrid working with columns with spaces without modifying the schema?
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope) {
$scope.myData = [{"name test": "Moroni", "age": 50},
{"name test": "Tiancum", "age": 43},
{"name test": "Jacob", "age": 27},
{"name test": "Nephi", "age": 29},
{"name test": "Enos", "age": 34}];
$scope.gridOptions = {
data: 'myData',
columnDefs: [{field:'name test', displayName:'Name'}, {field:'age', displayName:'Age'}]
};
});
Plunker code here: http://plnkr.co/edit/u6I3P8rG3PlUxsJLXqT1?p=preview