Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created November 17, 2018 15:25
Show Gist options
  • Save lydemann/e577dd396b4c9f915a460c0bbf08c132 to your computer and use it in GitHub Desktop.
Save lydemann/e577dd396b4c9f915a460c0bbf08c132 to your computer and use it in GitHub Desktop.
cards.component.html
<div class="cards-wrapper" *ngIf="data.length > 0; else noContent">
<div class="card-item" *ngFor="let dataItem of data">
<ng-container *ngIf="cardRef; else noCard" [ngTemplateOutlet]="cardRef" [ngTemplateOutletContext]="{data: dataItem}">
</ng-container>
</div>
</div>
<ng-template #noContent>
<div class="no-data">
{{'taskCards.noData' | translate}}
</div>
</ng-template>
<ng-template #noCard>
<div class="no-data">
{{'taskCards.noCardRef' | translate}}
</div>
</ng-template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment