<td *ngFor="let user of userService.users | async">
<div *ngIf="user?.data.apps.details[0].acknowledged as fooIcon">
<img *ngIf="fooIcon === "1" " src="./app/img/icones_sized/tick.png"/>
<img *ngIf="fooIcon === "0" " src="nothing_appears"/>
</div>
我试图显示一个图像,如果我的“.acknowledged”返回“1”,如果它返回“0”,则不应显示任何内容......它适用于字符串,但没有数字..我真的不明白为什么..
1 回答
您应该使用 *ngIf...else ,as