首页 > 解决方案 > What's the async for?

问题描述

Often we see pipe | and async in the value of an attribute/directive. For example

<ngx-datatable [rows]="rows | async"

May I ask what are they supposed for?

标签: javascriptangularngx-datatable

解决方案


Angular docs says:

Unwraps a value from an asynchronous primitive.

async pipe allows to avoid create variables or properties in TypeScipt. So we can use promises and observables in template.


推荐阅读