kolkov / ngx-gallery

A simple responsive native gallery component for Angular 8+.
https://ngx-gallery.kolkov.ru/
MIT License
115 stars 56 forks source link

ngx-gallery v2 with Angular13 [Image display problem] #89

Closed muratcanbatibay closed 2 years ago

muratcanbatibay commented 2 years ago

Hi, I installed ngx-gallery v2 in my Angular13 project. When I run the project I don't get any errors but I can't display any images either.

My Codes

getPhotosByCityId(id: number) { this.cityService.getPhotosByCityId(id).subscribe(response => { this.photos = response }) this.setGalery(); }

getImages() { const imgUrl = [] for (let i = 0; i < this.city.photos.length; i++) { imgUrl.push( { small: this.city.photos[i].url, medium: this.city.photos[i].url, big: this.city.photos[i].url } ) } return imgUrl; }

setGalery() { this.galleryOptions = [ { width: '100%', height: '400px', thumbnailsColumns: 4, imageAnimation: NgxGalleryAnimation.Slide }, // max-width 800 { breakpoint: 800, width: '100%', height: '600px', imagePercent: 80, thumbnailsPercent: 20, thumbnailsMargin: 20, thumbnailMargin: 20 }, // max-width 400 { breakpoint: 400, preview: false } ]; this.galleryImages = this.getImages(); } }

Html

<ngx-gallery *ngIf="galleryImages" [options]="galleryOptions" [images]="galleryImages" class="ngx-gallery">

Please can someone help me?

Vikas4790 commented 2 years ago

Not sure, but can it be related to issue #88. I am not able to load the lazy module itself when registering (importing) the NgxGalleryModule in Angular13 application with ngx-gallery v2.

muratcanbatibay commented 2 years ago

Not sure, but can it be related to issue #88. I am not able to load the lazy module itself when registering (importing) the NgxGalleryModule in Angular13 application with ngx-gallery v2.

But i can not see any error(s) on display..

Vikas4790 commented 2 years ago

Is this a lazy module component that is using ngx-gallery component? I too do not see any error in the console ourput. It is just that the entire lazy module is not loading when I go to the url that loads the lazy module. Though, I was able to get the error message only when I tried to create a fresh angular13 app and import the NgxGalleryModule.

muratcanbatibay commented 2 years ago

Is this a lazy module component that is using ngx-gallery component? I too do not see any error in the console ourput. It is just that the entire lazy module is not loading when I go to the url that loads the lazy module. Though, I was able to get the error message only when I tried to create a fresh angular13 app and import the NgxGalleryModule.

I don't use lazy module. When i getting pictures without use ngx-gallery, i displaying on the screen. But while i use ngx-gallery, i can not display any pictures.

.. When not using lazy module, can you displaying anything?

muratcanbatibay commented 2 years ago

This issue was resolved after the update ..

Thanks for the update.