How to check the length of an Observable array

后端 未结 8 2187
旧时难觅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:36

    This is what worked for me -

    *ngIf="!photos || photos?.length===0"
    

    I am getting my data from httpClient async.

    All the other options here didn't work for me which was disappointing. Especially the sexy (list$ | async) pipe.

    Basa..

提交回复
热议问题