javascript - AngularJS 按 ASC 排序

标签 javascript angularjs angularjs-orderby

我有一个 ng-repeat:

<label ng-repeat="atp in Keywords | unique:'atp'">
   {{atp}}
</label>

atp ,我得到:

client
animal
zoo
boat

我期望输出:

animal
boat
client
zoo

感谢您的帮助!

最佳答案

试试这个:

<label ng-repeat="atp in Keywords | unique:'atp' | orderBy:atp">
   {{atp}}
</label>

关于javascript - AngularJS 按 ASC 排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26778206/

相关文章:

javascript - AngularJS中Promise的.then和deferObj.resolve()之间的关系

javascript - 如何在angularjs中访问 Controller 中的多种形式?

javascript - 当分隔符从 ng : to ng- 更改时,Angular-JS 表排序不起作用

javascript - Angular orderBy :'timestamp' 把东西放在错误的顺序

javascript - 错误 : ER_PARSE_ERROR: You have an error in your SQL syntax;

html - Angular JS 过滤器基于类别数组的概述

javascript - 更新特定对象中的特定属性

javascript - 使用 Angular 的 orderBy 指令进行自定义排序

javascript - Repl.it javascript 类 - 无限循环

javascript - 在 Preact、Webpack 2 中使用 UglifyJS 时出现意外的 token 错误