ng 显示 ng 重复爱奥尼奥



如果value == null,我想隐藏离子行 我使用此代码,但它不起作用

<ion-row ng-show="item.Sex!= null">
<ion-col col-6>
<h5 class="title">Porn Date</h5>
</ion-col>
<ion-col col-2>
<h5 class="data">{{ item.Sex}}</h5>
</ion-col>
</ion-row>

此处为响应列表数据

DayAfterPorn:null
Expected: null
Id:2
IsBuy:false
IsDead:false
IsDeleted: false
Num : 2
Sex: null## Heading ##

为什么ng显示剂量甚至不起作用value == null

你应该使用 like !item。色情

<ion-row ng-show="!item.Porn">

您可以使用ng-show="item.Porn"[hidden]="!item.Porn"

我希望这对您/其他人有所帮助/指导。

如果您使用的是离子 1+ 版本

<ion-row ng-show="item.Porn"> 
<ion-col col-6> 
<h5 class="title">Porn Date</h5> 
</ion-col> 
<ion-col col-2> 
<h5 class="data">{{ item.Porn }}</h5> 
</ion-col> 
</ion-row>

如果您使用的是离子 3 版本

<ion-row [hidden]="!item.Porn"> 
<ion-col col-6> 
<h5 class="title">Porn Date</h5> 
</ion-col> 
<ion-col col-2> 
<h5 class="data">{{ item.Porn }}</h5> 
</ion-col> 
</ion-row>

我用 *ngif 来隐藏 elment

最新更新