Created
July 16, 2018 08:45
-
-
Save pyldin601/59840b185fdf468a41e6911018f1024b to your computer and use it in GitHub Desktop.
Async component example for angular 2+ (https://toddmotto.com/angular-ngif-async-pipe)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngIf="(user$ | async) as user; else loading"> | |
<user-profile | |
[user]="user"> | |
</user-profile> | |
<user-messages | |
[user]="user"> | |
</user-messages> | |
</div> | |
<ng-template #loading> | |
Loading stuff... | |
</ng-template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment