Skip to content

Instantly share code, notes, and snippets.

@4gray
Created October 26, 2018 12:19
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 4gray/d81015389e3fff1201c17507f7f94530 to your computer and use it in GitHub Desktop.
Save 4gray/d81015389e3fff1201c17507f7f94530 to your computer and use it in GitHub Desktop.
Angular If, Then, Else in html template
<ng-container*ngIf="isLoggedIn; then loggedIn; else loggedOut"></ng-container>
<ng-template #loggedIn>
<div>
Welcome back, friend.
</div>
</ng-template>
<ng-template #loggedOut>
<div>
Please friend, login.
</div>
</ng-template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment