Lavanya Akilan
Lavanya Akilan

Reputation: 179

How to use ng-if in ionic2 in html template file

if records is found i want to display the records otherwise to display the no records found.

i have used following code

<div  ng-if="program.videourl">
<video  width="100%" controls="controls" preload="metadata"  webkit-playsinline="webkit-playsinline" class="videoPlayer"><source [src]="program.videourl" type="video/mp4" autostart="false" /></video>
</div>

<!--if no records found under programs -->
<div  ng-if="!program.videourl">
    No records found .
</div>

But it displays both conditions.is there any mistake Please correct it

Upvotes: 0

Views: 265

Answers (1)

developer033
developer033

Reputation: 24884

It's *ngIf:

<div *ngIf="program.videourl">

Upvotes: 1

Related Questions