admin管理员组文章数量:1394968
Reading through this article and it has an ngFor loop like this:
*ngFor="let contact of contacts | async"
How does the async
pipe work in this context?
Reading through this article and it has an ngFor loop like this:
*ngFor="let contact of contacts | async"
How does the async
pipe work in this context?
- angular.io/api/mon/AsyncPipe. In other words, it tells the ponent to update when a new value is emitted (as opposed to an entire collection upfront) via a RxJS subscription. It also automatically unsubscribes the ponent from the observable when the ponent is destroyed. – ryanlutgen Commented Jan 8, 2018 at 23:25
1 Answer
Reset to default 5The async pipe gives the latest value from an observable. In this case (as in other cases) it will refresh the data involved when a new value es down the observable. So if the screen renders and the observable updates the ngFor will re-render.
本文标签: javascript*ngFor loop with async pipeStack Overflow
版权声明:本文标题:javascript - *ngFor loop with async pipe? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744096923a2590449.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论