Closed MathieuCoupe closed 2 years ago
When testing with cbOnSuccess callback, if found that adding a callback fix the missing field (in the event provided to the callback method and in the global event queue)
<button ngxClipboard [cbContent]="content" cbSuccessMsg="content successfully copied" (cbOnSuccess)="process($event)">
Thx for the quick response !
My issue is that we observe the global ClipboardService.copyResponse$ to avoid defining a callback for each ngxClipboard instance, and the event does not contain the successMessage field.
Would it be possible to enrich the event even if no local callback is registered ?
Something as :
let response: IClipboardResponse = {
isSuccess: succeeded,
successMessage: this.cbSuccessMsg,
event
};
totally, welcome to make a PR I will merge it. thx!
This issue is closed as part of Pull Request #300. Please close the issue.
issue fixed by #300
Starting from release 15.0.x of ngx-clipboard, assigning a string to the field cbSuccessMsg on the button no longer add it on the IClipboardResponse event generated.
eg: