Skip to content

Instantly share code, notes, and snippets.

@sayinserdar
Last active February 22, 2021 07:50
Show Gist options
  • Save sayinserdar/a1483c0c25b66fab96601a4f7b9655ee to your computer and use it in GitHub Desktop.
Save sayinserdar/a1483c0c25b66fab96601a4f7b9655ee to your computer and use it in GitHub Desktop.
// ❌
<div *ngIf="condition; else elseBlock">
<div class="cool-content">My beautiful styled content</div>
</div>
<ng-template #elseBlock>
<div>Same content but not cool </div>
</ng-template>
<div [class.cool-content]="condition">My beautiful styled content with nicer syntax</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment