How to Create an Image Lightbox in Angular | by Hayk Yaghubyan | Level Up Coding

PHOTO EMBED

Thu Nov 25 2021 01:33:19 GMT+0000 (UTC)

Saved by @sofiabedoy_96

<div class="image-row">
    <div class="image-column" *ngFor="let image of images; let i = index">
        <img src="{{image.url}}" (click)="openModal();currentSlide(i+1)" class="hover-shadow cursor">
    </div>
</div>
<div id="imgModal" class="slide-modal">
    <span class="close cursor" (click)="closeModal()">&times;</span>
    <div class="slide-modal-content">
        <div class="img-slides" *ngFor="let image of images; let i = index">
            <img src="{{image.url}}">
        </div>
        <a class="prev" (click)="plusSlides(-1)">&#10094;</a>
        <a class="next" (click)="plusSlides(1)">&#10095;</a>
        <div class="image-row">
            <div class="image-column" *ngFor="let image of images; let i = index">
                <img class="images" (click)="currentSlide(i+1)" src="{{image.url}}">
            </div>
        </div>
    </div>
</div>
content_copyCOPY

https://levelup.gitconnected.com/how-to-create-an-image-lightbox-in-angular-d7254e2c099