Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng show in ng repeat Ionic

Tags:

angular

ionic3

I want hide ion-row if value == null I use this code but it dose not work

<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>

here the response list data

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

Why ng show dose not work even value == null

like image 526
abd alrahman abu nada Avatar asked Sep 02 '26 11:09

abd alrahman abu nada


2 Answers

You should use like !item.Porn

<ion-row ng-show="!item.Porn">
like image 85
Sajeetharan Avatar answered Sep 05 '26 13:09

Sajeetharan


You can use ng-show="item.Porn" or [hidden]="!item.Porn"

I hope this will help/guide to you/others.

If you are using ionic 1+ version

<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>

If you are using ionic 3 version

<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>
like image 31
Krishna Rathore Avatar answered Sep 05 '26 14:09

Krishna Rathore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!