Use of filter in ng-repeat in jade templates

Asked

Viewed 43 times

1

Guys I think I’m doing something wrong but I’m not finding 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 that the songs are ordered in the order of the most voted. When I delete the ng-repeat filter works but nothing happens with the filter.

Some light?

1 answer

0

Well, I did a lot of research and couldn’t find the solution via filter. So I went to the javascript.Sort array and it worked fine.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.