ng-grid columnDefs显示{{col.displayName}}和{{grid.getCellValue}}

时间:2014-09-23 22:41:29

标签: javascript json angularjs ng-grid

我有这个控制器:

$scope.allOrders = [];
OrdersFactory.query().$promise.then(function(data) {
 $scope.allOrders = data;
});
$scope.gridOptions = {
    data: 'allOrders',
    columnDefs: [
        { name:'document_no', field: 'document_no' },
        { name:'waiter_name', field: 'waiter_name' }
    ]
};

工厂将获得此数据:

[
    {
        "id": 21, 
        "document_no": "RAC_21", 
        "waiter_name": "Name 2"
    }, 
    {
        "id": 20, 
        "document_no": "RAC_20", 
        "waiter_name": "Name"
    },
    ...
]

这是结果: enter image description here

为什么它不显示我的数据和前往桌面?

0 个答案:

没有答案