【发布时间】:2020-11-07 14:42:28
【问题描述】:
<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}}">
我有这样的数据:
item.menu_item_books['0'].monday: false
我想使用这些数据来显示元素。我创建一个数组:
weekdays = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
我想在 *ngIf 中使用 weekdays 数组的元素。我该怎么做?
【问题讨论】:
-
你能重新表述一下这个问题吗?你想让 if 语句做什么?
标签: angular angular-ng-if