javascript - 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?
解决方案
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.
推荐阅读
- javascript - 您可以将一组项目 ID 传递给平面列表吗?
- fluentd - 从标准输出读取 JSON 和纯文本
- javascript - 将“类别”应用于 Y 轴会导致 Highcharts 中的列开始和 X 轴之间出现间隙?
- reactjs - 如何访问从我的 firestore 数据库查询返回的数据?
- excel - 使用 Excel VBA 从网站上抓取当前日期
- php - session_write_close():无法使用用户定义的保存处理程序写入会话数据。PHP 7.3.1
- ruby-on-rails - 如何让 webpack-dev-server 尊重 rbenv 配置?
- python - 为什么有时在 python 中会出现此错误?
- sql - 编辑和更新连接的查询
- python - 如何使用geoquery查询并获取某人在elasticsearch 7中行走的不同名称?可能吗?