Last active
December 9, 2023 07:21
-
-
Save MurhafSousli/bbe41040f3dabd8a2fd918a9e3602183 to your computer and use it in GitHub Desktop.
Proposal: Carousel usage
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
<carousel [data]="items"> | |
<carousel-thumbs></carousel-thumbs> | |
<div *carouselItem="let item"> | |
<img src="item.src"> | |
</div> | |
<div *carouselThumb="let item"> | |
<img src="item.thumb"> | |
</div> | |
</carousel> | |
<!-- π Cannot add items individually, must have a custom for loop --> | |
<!-- π No type checking / autocompletion --> | |
<!-- π items object is passed using an input --> | |
<!-- π No need for ng-container --> |
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
<carousel> | |
<carousel-thumbs></carousel-thumbs> | |
<ng-container *carouselFor="let item of items"> | |
<div carouselItem> | |
<img src="item.src"> | |
</div> | |
<div carouselThumb> | |
<img src="item.thumb"> | |
</div> | |
</ng-container> | |
</carousel> | |
<!-- π Cannot add items individually, must have a custom for loop --> | |
<!-- π Type checking / autocompletion can be accomplished --> | |
<!-- π Has to be used on ng-container if thumb template needed --> | |
<!-- π items object is passed using an input --> |
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
<carousel> | |
<carousel-thumbs></carousel-thumbs> | |
<ng-container *ngFor="let item of items"> | |
<div *carouselItem> | |
<img src="item.src"> | |
</div> | |
<div *carouselThumb> | |
<img src="item.thumb"> | |
</div> | |
</ng-container> | |
</carousel> | |
<!-- π Can add items individually without ngFor --> | |
<!-- π Type checking / autocompletion is available --> | |
<!-- π Traditional ngFor --> | |
<!-- π Must to be used on ng-container --> | |
<!-- β Use ContentChildren stream to project items --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment