How to pass ng-repeat {{$index}} as a mixin parameter? (Angularjs)

Asked

Viewed 122 times

1

I am working with Aquivos . jade and using ng-repeat from Angularjs 1.5.8. I cannot pass a {{$index}} as a parameter in a mixin. This parameter is a string that defines an ng-model within the mixin.

Ex.:

.row(ng-repeat="atendimento in cadastro.atendimento")
     +checkbox("cadastro.perfil[{{$index}}].nome", true, null)

Error occurs in the keys "{{ }}" and seems to be related by being inside the brackets '[ ]'. If you send only "{{$index}}", it works normally, as expected.

1 answer

0

So you’re allocating it wrong.

Come on.

No ng-repeat use this way:

td(ng-repeat='atendimento in cadastro.atendimento track by $index')
    +checkbox("{{cadastro.perfil[$index].nome}}", indice="{{$index}}")

a way too:

ng-model="cadastro.perfil[$index]"

Browser other questions tagged

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