ngx-clipboard
ngx-clipboard copied to clipboard
Using `copyFromContent` from `ClipboardService` does not give callback in `copyResponse$`
From your documentation it seems that I should always get call back whenever a copy is successful. I am getting callbacks when copied using template modifications. But when I copy something using copyFromContent
there seems to be no callback.
I tested on https://stackblitz.com/github/maxisam/ngx-clipboard
as well and the alert is not displayed when Copy from Service
button is clicked.
Am I missing something?
Should use copy instead. I probably should deprecated copyFromContent. Thx
Please consider reopening this. Sometimes we need to pass the container to the service, for instance if the content is copied from a modal. See the issue described here.
In my case I have an Angular app that uses an Ionic-based framework, and if the content resides in a modal I need to do something like this to get the copy functionality to work:
this.clipboard.copyFromContent(
stringToCopy,
document.querySelector('ion-modal') ?? undefined
);
@KemalPajevic is the current behavior still working for you?