3

I have implemented displaying images using ngx-image viewer in Angular. By default next(>), previous(<) buttons are displayed. On click of next/previous arrow I want to perform an event. As these are default icons, I am stuck on how to call the event on click of the icons

I have tried as below:

HTML

<ngx-image-viewer [src]="images"
    (next)="gonext($event)"
    (previous)="goprevious($event)">
</ngx-image-viewer>

TS Code

gonext(event){
  console.log("event next",`${event.name}`);
}

goprevious(event){
  console.log("event previous",`${event.name}`);
}

ngx options for an image

Andreas
  • 1,061
  • 1
  • 11
  • 26

0 Answers0