【发布时间】:2015-12-15 21:13:22
【问题描述】:
我们有以下 JSON 格式从 rest 服务返回的数据,我想按 ActivityStartDate and then show in format 对数据进行分组。我可以通过ActivityStartDate 遍历并创建组,但如果我们返回更多项目,这似乎不是有效的方法。
有没有更好的方法来实现它?
{
"results": [
{
"Id": 1,
"Title": "Food Promotion - 1",
"ActivityStartDate": "2015-12-12T08:00:00Z",
"ActivityEndDate": "2016-01-12T08:00:00Z",
"ActivityDescription": "Two for one if dream and do not dream of fack promotions",
"ShowInHistory": true,
"ShowUpdated": true,
"Modified": "2015-12-14T21:28:37Z",
"Created": "2015-12-14T21:28:37Z"
}
]
}
【问题讨论】:
-
您使用的 REST API 是否允许您按组查询?如果没有,您可能只需要编写一个函数来迭代数据。
标签: angularjs angularjs-ng-repeat angular-controller