以下示例是关于Html中包含ngif 异步管道用法的示例代码,想了解ngif 异步管道的具体用法?ngif 异步管道怎么用?ngif 异步管道使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。
<div *ngIf="user$ | async as user">
<user-profile
[user]="user.profile">
</user-profile>
<user-messages
[user]="user.messages">
</user-messages>
</div>
<!--
In Angular2+ it is possible to use ngif and async pipe without headaches!
When the user observable pushes a value it gets stored in the user variable.
Can use user.stuff from then on.
-->
本文地址:https://www.itbaoku.cn/snippets/785204.html