How to check the length of an Observable array

后端 未结 8 2174
旧时难觅i
旧时难觅i 2020-12-02 08:19

In my Angular 2 component I have an Observable array

list$: Observable;

In my Template

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-02 08:43

    You can use the | async pipe:

    No records found.

    Update - Angular Version 6:

    If you are loading up a css Skeleton you can use this. If the array has no items it will display the css template. If there is data then fill out the ngFor.

    • {{ listItem.text }}

    Shows when no data, waiting for Api

提交回复
热议问题