good first issuetype: enhancement
説明
So, ui-grid has this feature:
$scope.data = data; And then direct the grid to resolve whatever is in $scope.data: $scope.gridOptions.data = 'data';
But, when object's property contains data, like, $scope.container.data = []
$scope.gridOptions.data = 'container.data' isn't working.
I have an idea how to fix this:
function getComplexBinding(name, startObj) {
var path = name.split(/[.\[]/);
var object = startObj;
angular.forEach(path, function (val, key) {
val = val.replace(new RegExp(/['"\]]/, 'g'), '');
object = object[val];
if (object == null) {
return null;
}
});
if (object === startObj) {
return null;
}
return object;
}
And replace
this line with:
newData = getComplexBinding($scope.uiGrid.data, self.grid.appScope);