当我做到这一点:
<ul>
<template *ngFor="let flag of [1,2,3,4]">
<li *ngIf="flag == 1">
some data
</li>
</template>
</ul>
我得到它
<ul>
<!--template bindings={
"ng-reflect-ng-for-of": "1,2,3,4"
}-->
<!--template bindings={}-->
<!--template bindings={}-->
<!--template bindings={}-->
<!--template bindings={}-->
</ul>
它无法显示。 我需要在* ngFor显示<li>
只有当item.flagsExplain[flag]
设置
请给出[MCVE]包括输入对此。 – jonrsharpe
更新了问题 –
但是输入*在哪里?什么是“物品”? 'service'? – jonrsharpe