maxisam / ngx-clipboard

A pure angular clipboard directive
http://maxisam.github.io/ngx-clipboard/
MIT License
504 stars 93 forks source link

cbOnSuccess eventEmitter not working #307

Closed hags033 closed 2 years ago

hags033 commented 2 years ago

As of version 15.x.x cbOnSuccess event emitter is no longer working. This works in the previous version 14.0.2.

Modified stackblitz https://stackblitz.com/edit/github-nn4hwx-6v83rt?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.component.ts

rahuldimri commented 2 years ago

This works correctly. Verified by creating samples with version 14.0.2 and 15.1.x. Please close this issue or provide more details

hags033 commented 2 years ago

In the stackblitz I have added an output to the first button (cbOnSuccess)="onSuccess($event)" and in the component

     onSuccess(event) {
        alert('copy success');
    }

This onSuccess method in the component does not fire as of version 15.x.x of the library.

rahuldimri commented 2 years ago

I was able to get "copy success" alerts. PFA the screenshot.

Screenshot 2022-06-14 at 11 18 41 PM
hags033 commented 2 years ago

Closing as my best guess is it's a conflict with one of our other dependencies. We moved from Angular 10 to Angular 13 and ngx-clipboard 14 to ngx-clipboard 15 and all 4 places cbOnSuccess was used no longer work.

Eraldo commented 2 years ago

cbOnSuccess does also not fire for me using Angular 14.

Darkein commented 2 years ago

I have the same problem with angular 14.1.3 and ngx-clipboard 15.1.0

Nevertheless, using clipboardService.copyResponse$.subscribe(() => { }); is working correctly.