How to check the length of an Observable array

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

    Your approach here has another major issue: by leveraging the async pipe over and over in your template, you are actually kicking off that many subscriptions to the single Observable.

    KAMRUL HASAN SHAHED has the right approach above: Use the async pipe once and then provide an alias for the result that you can leverage in child nodes.

提交回复
热议问题