ngx-gallery icon indicating copy to clipboard operation
ngx-gallery copied to clipboard

ngx gallery package onClick action is not working

Open pkmarathe opened this issue 5 years ago • 2 comments

galleryAction: NgxGalleryAction[];

ngOnInit(): void { this.galleryOptions = [ { "image": false, "preview": false, "thumbnailActions": this.galleryAction, "height": "515px", "width": "1200px", "thumbnailsRows": 3, "thumbnailsColumns": 7, "thumbnailsMargin": 10, "thumbnailsPercent": 100, }, { "breakpoint": 500, }, ]; this.handleClick = this.handleClick.bind(this); this.galleryAction = [{ icon: "TestData", onClick: this.handleClick }]; }; handleClick(): void { debugger; console.log("test"); }

pkmarathe avatar Jan 22 '20 09:01 pkmarathe

Your code is not correct.

this.handleClick = this.handleClick.bind(this);

As far as I see assigning a function of an angular component with the same function again with a bind call would achieve nothing and has nothing to do with ngx-gallery.

SnippetsUnlimited avatar Jan 27 '20 15:01 SnippetsUnlimited

@lukasz-galka What is the correct way to bind the click event

svipandi avatar Dec 29 '20 06:12 svipandi