Created
November 16, 2023 10:05
-
-
Save sp90/45ad31c0d6f532acb15093a03be6fb10 to your computer and use it in GitHub Desktop.
Angular material expansion panel lazy load on expand using the angular v17 control flow
This file contains hidden or 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
<mat-accordion> | |
@for (some of someArr; track some.id) { | |
<mat-expansion-panel #mep="matExpansionPanel"> | |
<mat-expansion-panel-header> | |
<mat-panel-title> | |
{{ some.title }} | |
</mat-panel-title> | |
</mat-expansion-panel-header> | |
@defer (when mep.expanded) { | |
@for (item of some.list; track item.id) { | |
<div class="item"> | |
<div | |
class="img-container" | |
[style.background-image]="'url(' + item.uri + ')'" | |
></div> | |
{{ item.name }} | |
</div> | |
} | |
} | |
</mat-expansion-panel> | |
} | |
</mat-accordion> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment