Created
May 1, 2020 12:29
-
-
Save NyaGarcia/8990fd310e67376ee488b2f29fe05b1b to your computer and use it in GitHub Desktop.
Usage example of the Observable directive
This file contains 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
<p *observe="users$ as users; before loadingTemplate; error errorTemplate"> | |
There are {{ users.length }} online. | |
</p> | |
<ng-template #loadingTemplate> | |
<p>Loading ...</p> | |
</ng-template> | |
<ng-template #errorTemplate let-error> | |
<p>{{ error }}</p> | |
</ng-template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment