Using the filter in ng-repeat in jade templates

1

Personally I think I'm doing something wrong but I can not find the error in the code.

ul(class='list-group')
        li(class="list-group-item", ng-repeat="v in votadas | filter: '-votos'")
          h4 Música: {{ v.titulo }} | Votos: {{ v.votos }}

My intention is for the songs to be sorted in the most voted order. When I delete the filter from ng-repeat it works but with the filter nothing happens.

Any light?

    
asked by anonymous 12.12.2015 / 22:28

1 answer

0

Well, I researched a lot and did not find the solution via filter. So I turned to javascript's array.sort and it worked fine.

    
13.12.2015 / 16:31