Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created May 1, 2020 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NyaGarcia/8990fd310e67376ee488b2f29fe05b1b to your computer and use it in GitHub Desktop.
Save NyaGarcia/8990fd310e67376ee488b2f29fe05b1b to your computer and use it in GitHub Desktop.
Usage example of the Observable directive
<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