hi guy, there is a field,i am not sure whether it is empty.so i hope as it is empty .the element hide.i try many ways.all failed. can someone tell the righ way to solve the problem? thanks bro.
this a detailpage, passenger is a model, the data of detail , passed from a list. data shows is normal. CarType may be empty.so if empty,i hide this elment.
here some ways from google searche. failed.never hide the element
<ion-label ng-if="passenger.CarType.length > 0">,{{passenger.CarType}}</ion-label>
<ion-label ng-if="!passenger.CarType">,{{passenger.CarType}}</ion-label>
<ion-label ng-if="passenger.CarType">,{{passenger.CarType}}</ion-label>
<ion-label ng-if="!!passenger.CarType">,{{passenger.CarType}}</ion-label>
<div *ngIf="passenger.CarType">,{{passenger.CarType}}</div>
<div *ngIf="!passenger.CarType">,{{passenger.CarType}}</div>
<span ng-if="!passenger.CarType">null</span> <span ng-if="passenger.CarType">null</span>
<span ng-show="passenger.CarType">null</span> <span ng-show="!passenger.CarType">null</span>
<span ng-show="passenger.CarType==''">null</span> <span ng-show="passenger.CarType== null">null</span>