【发布时间】:2014-03-10 19:06:12
【问题描述】:
我有一些如下所示的 JSON 数据:
return {
"activityTypes" :[{
"id" :"",
"name:" :"",
"icon" : "",
"partial": "",
"label" : {
"id": "",
"name": ""
}
}],
"apiKey" : "",
"approveBy": 0,
"approvers" : [],
"canSendTo" : [{
"id" : "",
"name" : ""
}],
"creators" : [],
"isActive" : false,
"notification" : false,
"sourceId": "",
"sourceName":""
};
我正在尝试使用 ng-grid,但在尝试访问对象数组中的元素时遇到了麻烦,例如 activityTypes 或 canSendTo 数组。在以下示例中,我尝试显示 canSendTo 的 id。我尝试了以下方法,但它没有在屏幕上呈现。有想法该怎么解决这个吗?谢谢!
{field: 'canSendTo.id', displayName: 'Can Send To', width:'10%',
cellTemplate: '<div class="ngCellText", style="white-space: normal;">{{row.getProperty(col.field)}}</div>'},
【问题讨论】:
标签: javascript arrays json angularjs ng-grid