Am developing android application am getting data from service call am checking only “null”.
when data is empty i want to display “NA”.
(Issue is when data is empty html view is getting blank)
when data is present am showing data on html view
HTML Code below:
<ion-content padding class="no-scroll background">
<ion-item class="showCompletedItem">
<ion-label class="showCompletedLabel">Show Completed?</ion-label>
<ion-checkbox item-right [(ngModel)]="showCompleted" (ionChange)="toggleShowCompleted()" class="showCompletedCB"></ion-checkbox>
</ion-item>
<ion-item class="proSelectDiv">
<ion-label class="proSelectLabel">Please select a Pro</ion-label>
<ion-select [(ngModel)]="currentPro" (ionChange)="handleProChange()">
<ion-option *ngFor="let dispatch of dispatches; let i = index;" selected="{{(i==0).toString()}}">{{dispatch.division}}-{{dispatch.proNumber}} {{dispatch.shortDate}}</ion-option>
</ion-select>
</ion-item>
<ion-grid class="proDateDiv">
<ion-row sytle="margin-bottom: 5px;" *ngIf="currentDispatch != null">
<ion-col col-2>Pro:</ion-col>
<ion-col col-3>{{currentDispatch.division}}-{{currentDispatch.proNumber}}</ion-col>
<ion-col col-2>Date:</ion-col>
<ion-col col-5>{{formatDate(currentDispatch.dispatchDate)}}</ion-col>
</ion-row>
</ion-grid>
<dispatch-detail *ngIf="detailInfoOne != null" #detailOne [detailInfo]="detailInfoOne" [index]="0" (receivedClick)="handleChildClick($event)"></dispatch-detail>
<dispatch-detail *ngIf="detailInfoTwo != null" #detailTwo [detailInfo]="detailInfoTwo" [index]="1" (receivedClick)="handleChildClick($event)"></dispatch-detail>
<dispatch-detail *ngIf="detailInfoThree != null" #detailThree [detailInfo]="detailInfoThree" [index]="2" (receivedClick)="handleChildClick($event)"></dispatch-detail>
<dispatch-detail *ngIf="detailInfoFour != null" #detailFour [detailInfo]="detailInfoFour" [index]="3" (receivedClick)="handleChildClick($event)"></dispatch-detail>
<dispatch-detail *ngIf="detailInfoFive != null" #detailFive [detailInfo]="detailInfoFive" [index]="4" (receivedClick)="handleChildClick($event)"></dispatch-detail>
</ion-content>