-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(results-list): update ngFor, ngIf with control-flow syntax
- Loading branch information
Showing
2 changed files
with
20 additions
and
22 deletions.
There are no files selected for viewing
27 changes: 13 additions & 14 deletions
27
...ub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
15 changes: 7 additions & 8 deletions
15
apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |