0

I'm working on a project which has front end app in Angular. After cast my response coming from back end API,I'am trying to display array data in table,if condition come true here is my array of data compte['ingroup'].

<ul class="nav nav-list " *ngFor=" let compte of  comptes">
   <label class="groupcompte" *ngIf="{{compte['ingroup']}}.lenght > 0" >                                                                
      {{compte['ingroup']| json}}
   </label>
</ul>

My question is about know how to get compte['ingroup'] lenght in my condition thank you

1 Answer 1

1

It should be *ngIf="compte['ingroup'].length > 0"

Sign up to request clarification or add additional context in comments.

4 Comments

You don't use {{}} in ngIf expressions!
My bad! Corrected it
sorry but I have try what your suggest but it's not working
In that case, can you please share a bit more? like your data structure of comptes and what exactly are you trying to show in your table?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.