2
<ion-col size="12" *ngFor="let day of weekdays">
     <h5>{{day | titlecase }}</h5>
     <ion-grid fixed>
         <ion-row>
         <ng-container *ngFor="let item of category.menu_items">
         <ion-col sizeLg="4" size="12" *ngIf="item.menu_item_books['0'].{{day}}">

I have a data like this:

item.menu_item_books['0'].monday: false 

I want using to use this data for showing element. I create an array:

weekdays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];

I want using weekdays array's element in *ngIf. How can I do this?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Mustafa.psd
  • 27
  • 2
  • 9

1 Answers1

3

you can write it like that

*ngIf="item.menu_item_books['0'][day]"
Reaper
  • 402
  • 3
  • 13