【发布时间】:2017-03-05 04:16:52
【问题描述】:
如何遍历表中的follow JSON数据
对象 { itemCode=1, itemDesc="Banana", amount=23,}
【问题讨论】:
如何遍历表中的follow JSON数据
对象 { itemCode=1, itemDesc="Banana", amount=23,}
【问题讨论】:
试着写一个像follow这样的角度的过滤器
app.filter('reverse', function() {
return function(items) {
return items.slice().reverse();
};
});
或
app.filter('reverse', function() {
return function(items) {
return items.reverse();
};
});
然后在 ng-repeat 中使用该过滤器,如下所示:
<div ng-repeat="item in items | reverse">{{item}}</div>
【讨论】: