Ionic framework 如何在下面的代码中使用*ngIf条件?
在这里,我想检查情况,但我无法检查Ionic framework 如何在下面的代码中使用*ngIf条件?,ionic-framework,Ionic Framework,在这里,我想检查情况,但我无法检查 <text-avatar id="av" item-start [text]="item.BN" [color]="item.color"> <ion-icon id="check" name="checkmark-circle" float-start></ion-icon> </text-avatar>
<text-avatar id="av" item-start [text]="item.BN" [color]="item.color">
<ion-icon id="check" name="checkmark-circle" float-start></ion-icon>
</text-avatar>
就这么简单,其中
someBoolean
可以是通过组件类检索到的任何布尔值
home.tst
. . .
class Home {
var someBoolean: boolean = false;
var myArray: any[];
constructor() {
// compare values with array here or in any other method
if (true) {
someBoolean = true;
}
}
}
home.html
<text-avatar id="av" item-start [text]="item.BN" [color]="item.color" *ngIf="someBoolean">
<ion-icon id="check" name="checkmark-circle" float-start></ion-icon>
</text-avatar>
所以当某件事情完成时,您希望显示一个复选标记,对吗?是的!!对的。。你有我的问题,我必须检查倍数并与数组进行比较如何将单个值与数组[1,2]进行比较