Skip to content

Commit

Permalink
fix: only execute clickListener if defined (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
junglebarry authored Dec 13, 2021
1 parent 8d620cc commit c0868e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export class ClipboardDirective implements OnInit, OnDestroy {
}

public ngOnDestroy() {
this.clickListener();
if (this.clickListener) {
this.clickListener();
}
this.clipboardSrv.destroy(this.container);
}

Expand Down

0 comments on commit c0868e2

Please sign in to comment.