How do I convert angular ng-repeat to Flask?

Asked

Viewed 12 times

0

How can I do the same Angular ng-repeat function in Flask?

<tbody ng-repeat="x in oCtrl.ListaProdutosAno | filter:{codigoProduto: produto_estatistica.codigoProduto} track by x.codigoProduto + x.ano">
    <tr>
        <td class="text-center" style="vertical-align: middle; width: 4%">
            {{x.ano}}
        </td>
    </tr>
</tbody>

I know the part ng-repeat="x in oCtrl.ListaProdutosAno can be done with a for x in oCtrl.ListaProdutosAno, but I didn’t quite understand what the part | filter:{codigoProduto: produto_estatistica.codigoProduto} track by x.codigoProduto + x.ano does and how it could be in Flask.

  • Perhaps it would not be the case to already bring the list formatted? Why in the case of ng-repeat I imagine it’s done on the client’s side, and the flask uses the server-side processed template engine. It would not be the case to refactor the return logic of the products?

  • 1

    @Wallacemaxters, I hadn’t thought of that, vlw by the tip.

No answers

Browser other questions tagged

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