Skip to content

Commit

Permalink
refactor(results-list): update ngFor, ngIf with control-flow syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tkohr committed Jan 18, 2024
1 parent 2d789dc commit c1760e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<div class="relative">
<div class="flex gap-4 p-4">
<div
*ngFor="let record of searchFacade.results$ | async"
@for (record of searchFacade.results$ | async; track
record.uniqueIdentifier) { @if (favoritesOnly) {
<mel-datahub-results-card-favorite
[style]="'height: 12em;'"
>
<mel-datahub-results-card-last-created
*ngIf="!favoritesOnly"
[record]="record"
(mdSelect)="onMetadataSelection($event)"
></mel-datahub-results-card-last-created>
<mel-datahub-results-card-favorite
*ngIf="favoritesOnly"
[record]="record"
(mdSelect)="onMetadataSelection($event)"
></mel-datahub-results-card-favorite>
</div>
[record]="record"
(mdSelect)="onMetadataSelection($event)"
></mel-datahub-results-card-favorite>
} @else {
<mel-datahub-results-card-last-created
[style]="'height: 12em;'"
[record]="record"
(mdSelect)="onMetadataSelection($event)"
></mel-datahub-results-card-last-created>
} }
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<div class="relative">
<div class="grid md:grid-cols-2 lg:grid-cols-4 gap-4 p-4">
<div
*ngFor="let record of searchFacade.results$ | async"
@for (record of searchFacade.results$ | async; track
record.uniqueIdentifier) {
<mel-datahub-results-card-search
[style]="'height: 24em;'"
>
<mel-datahub-results-card-search
[record]="record"
(mdSelect)="onMetadataSelection($event)"
></mel-datahub-results-card-search>
</div>
[record]="record"
(mdSelect)="onMetadataSelection($event)"
></mel-datahub-results-card-search>
}
</div>
</div>

0 comments on commit c1760e4

Please sign in to comment.