文章详情页
angular.js - angular ng-repeat通过数值的大小从小到大排序
浏览:62日期:2024-09-24 15:05:56
问题描述
使用ng-repeat循序出来的p按照returnbanner里面的index值从小到大排序,怎么做呢
问题解答
回答1:升序:
<ul> <li ng-repeat='user in users | orderBy:user.index'>{{user.name}}</li></ul>
倒序:
<ul> <li ng-repeat='user in users | orderBy:user.index:’desc’'>{{user.name}}</li></ul>
多看看官方文档...
相关文章:
1. javascript - 我写的href跳转地址不是百度,为什么在有的机型上跳转到百度了,有的机型跳转正确2. node.js - 微信的自动回复问题3. python - Scrapy中xpath用到中文报错4. 微信小程序如何将获取的时间戳提交到数据库?5. python - 如何给模块传参数,参数是模块的函数名?6. node.js - nodejs中mysql子查询返回多行结果怎么处理?7. mysql - 为什么innodb下更新A行时B行也被锁住?8. 请问python中为什么我用for循环对嵌套列表进行赋值时,都是以i的最终值来计算的?9. linux - python编译ssl错误10. mysql - spring data jpa 方法sql复杂查询?
排行榜