Angular :4 How to create a clipboard copy functionality
I love learning about technology and sharing that with others
Steps
- install ngx-clipboard
- Add the clipboardModule in the app.module
import { ClipboardModule } from 'ngx-clipboard';
- in your template create a text area and then add a button in the text area add a reference and int he button we will add the ngxClipboard that will copy the text from the textarea
<div class="form-group">
<button [ngxClipboard]="requestjsontext" style="float:right;" class="btn btn-primary">copy</button>
<label for="requestjson">Request Json</label>
<textarea class="form-control" id="requestjsontextarea" rows="5" #requestjsontext></textarea>
</div>

