Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework 如何在下面的代码中使用*ngIf条件?_Ionic Framework - Fatal编程技术网

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]进行比较