I have an angular service which returns a string and I want this string to be in the user's clipboard.
I've installed angular2-clipboard to display the result in an input and let the user also click on the "copy" button in case of automatic copy failure. But my wish is that when the input value bound to a property changes, it automatically set the clipboard content with that new value.
This is currently working:
<input readonly type="text" class="form-control" [(ngModel)]="createdCode">
<button class="btn btn-default" type="button" ngIIclipboard [cbContent]="createdCode">copy</button>
I have tried to find a way with ng-change to call "#btn.onclick()" to raise the click event but could not get the expected behaviour.
Is there a way to do this?