0
<div *ngFor="let elemento of team.elementos" class="{{elemento.colunas}}">
<div *ngIf="(elemento.dataPublicacao < hoje) && (elemento.dataValidade > hoje)">
<span>{{qtdIntegrantes}}</span>
<div *ngIf="qtdIntegrantes == 1">
<div class="team-member">
<img class="mx-auto rounded-circle" src="{{getCampoElem(elemento, 'img')}}" alt="">
<h4>{{getCampoElem(elemento, 'nome')}}</h4>
<p style="margin-bottom:0px" class="text-muted">{{getCampoElem(elemento, 'posto')}}</p>
<p style="margin-bottom:0px" class="text-muted numdesk">{{getCampoElem(elemento, 'telf')}}</p>
<a class="text-muted nummob"
href="{{getCampoElem(elemento, 'telfhref')}}">{{getCampoElem(elemento, 'telf')}}</a>
</div>
</div>
</div>
</div>
Basically every time the condition of ngIf
is met, the qtdIntegrantes
should increase, there is some way to do this in Angular?
Better to do this logic in typescript than in ngIf
– Eduardo Vargas
why not do no ts?
– caribeedu
What would I call the function on ts?
– Matheus Ribeiro
the
ngIf
is only a render filter based on the entered condition. If you want to change the variable valueqtdIntegrantes
you can do a for on ts that changes the variable value.– rogerdossantos