Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

Ionic v4 - ion-skeleton-text - Best practice

$
0
0

@onlygio wrote:

Hello, I’m experimenting ion-skeleton-text and it works like a charm.
Now I want to know the best practice to get rid of this problem:

When I’m loading my list the skeleton is ok, but when the list is empty I want to show a message instead of the fake loading.

This is a pseudo code used

List.html
<ion-list>
<ion-item *ngFor="let person of persons">
<ion-label>{{ person.name }}</ion-label>
</ion-item>
</ion-list>

<ion-list *ngIf="!persons.length > 0">
<ion-item *ngFor="let item of [1,2,3,4,5]">
<ion-label>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</ion-label>
</ion-item>
</ion-list>

I’ve tryed some work around, but I’m looking for the right way!

Thanks in advance

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>