AngularJS OrderBy ASC

时间:2014-11-06 11:20:42

标签: 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

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

试试这个:

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