Issue
What is the correct way of doing a ngIf then else when you have a count involved? Please refer to the example below for more info:
<div *ngIf={{ returnedTotalResults }} > 0 then #paging;else #no_data_found></div>
<pagination #paging></pagination>
<p #no_data_found>No results found</p>
Solution
You need to put your ngIf as a string, some some tags around and remove the string interpolation:
<div *ngIf=" returnedTotalResults > 0; else no_data_found">
<pagination></pagination>
</div>
<ng-template #no_data_found>
<p>No results found</p>
</ng-template>
https://angular.io/api/common/NgIf
Answered By - anthonyb
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.