Search code examples
javascriptangularjsangularjs-orderby

AngularJS OrderBy ASC


I have a ng-repeat:

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

In atp, I got:

client
animal
zoo
boat

I expect in output:

animal
boat
client
zoo

Thanks for your help!


Solution

  • Try this:

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