0

I have integrated ngx-gallery into my project.

My component now looks like this:

<div class="page-content">
 <ngx-gallery [options]="galleryOptions" [images]="galleryImages" fxFlex="70"></ngx-gallery>
 <button (click)="updateGallery()">CLICK!</button>
</div>

I am trying to use the following function in order to update my gallery:

  updateGallery(): void {
      this.galleryImages = this.galleryImagesCache.slice(0, Math.floor(Math.random() * (15 - 1)) + 1);
  }

However, it appears once the ngx-gallery component is initialized, it will not update it's contents. Any advice would be greatly appreciated.

4
  • 1
    Are you initializing the in NgxGalleryModule in constructor? Commented May 2, 2017 at 15:46
  • @SumitRidhal, no I am not, when I do initialize it in the constructor, what is the next step? Thanks Commented May 2, 2017 at 16:02
  • Probably this lib just do setting in OnInit and does not process onChanges. Open an issue on github for this lib Commented May 2, 2017 at 16:29
  • @JuliaPassynkova, thanks for the suggestion - he looked into it! Commented May 4, 2017 at 18:19

1 Answer 1

2

Probably this lib just do setting in OnInit and does not process onChanges. Open an issue on github for this lib.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, reached out to the dev and he implemented it right away. Kudos for real life experience

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.