乐呵呵网
  • 首页index
  • 电脑知识pc
  • 手机知识mobile
  • 软件教程soft
  • 编程技术code
  • 生活常识life
  • 常见问答answer
  • 美食之家cate
  • 健身养生keep
  • 吃喝玩乐happy
您的位置:首页常见问答文章内容

angular.js - angularjs中ng-repeat如何实现按年龄降序排序??

浏览:80日期:2022-12-24

问题描述

ng-repeat如何实现按点赞数量降序排序,从大到小排序

问题解答

回答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>

上一条:angular.js - angularjs中directive的ng-click为什么不能传递参数下一条:angular.js - ui.router 二级嵌套,一级的可以跳,二级不能
相关文章:
1. javascript - 关于input="file",重复选择同一文件时不触发change事件的问题2. 为什么矛那里的 <a href=" " 这地方为什么是空的呢 ??3. 为什么总是提示我说Template "movieTemplate" not found,我路径都引对了呀4. <tr valign="top"> 看不懂5. solaris基础和常用知识 (2)6. MySQL"="自动 like7. node.js mysql Cannot find module "net" 和 "tls"和"fs" 的问题8. mysql 使用 join 还是 "," 进行多表查询???9. mysql - 使用hibernate连接数据库时,数据库版本过高不支持关键字"type" ;10. 发现 <li><a href="/index.php">回到前台</a></li>这样回到首页后,不是登录状态
热门推荐
  • python - pip list时提示Unable to create process using ’
  • python - pip list时提示Unable to create process using ’"’
  • 1.存在并且显示出来的DOM元素取不到,只有审查元素之后才能取到?
  • 2.反复看了几遍,不知道问题出在哪儿?
  • 3.javascript - 一个字符串转换成数字,例子就是a="2,322.222",b=’1,211.21’,如何在angualr中执行相减
  • 4.laravel,怎么在在页面中获取Session中保存的数据
  • 5.spl_autoload_register(function($class){}回调函数的参数$class是如何识别要加载的类的?
  • 6.objective-c - @property重写 setter 和 getter 方法
  • 7.有了docker之后是否开放应用是否不需要考虑多用户了?
  • 8.为什么总是提示我说Template "movieTemplate" not found,我路径都引对了呀
  • 9.c语言 - C++字符串逆乘法问题
  • 10.同一个命名空间中类的引用

网公网安备:皖ICP备2020019022号-8 Copyright ¢ 2020-2025 Powered by V1.8 All Rights Reserved 技术支持:乐呵呵网

声明:本站所有资源以学习为主