How to copy to clipboard without flash in AngularJS ?By Hardik Savani | February 21, 2017 | | 1213 Viewer | Category : jQuery AngularJS
Share this post:
In this post we are going learn how to copy to clipboard in AngularJS application using ngclipboard js plugin. I provide very simple example using CDN, so you can simply run and understand well.
when require to give function of copy some text by clicking on button or any link. There are several library can do copy text using flash player, but in this example i will do it without using flash player. In this example we will use
ngclipboard.js AngularJS Plugin for copy to clipboard.
Now i am going to share with you full example of ngclipboard js plugin. I use cdn for jquery and ngclipboard js that way you can run easily for testing. You can also see demo. So let's see bellow example:
<title>How to copy to clipboard without flash in AngularJS ?</title>
<div class="container" ng-app="mainApp">
<!-- Target -->
<input id="foo" value="I am copied from ItSolutionStuff.com">
<!-- Trigger -->
<button class="btn" ngclipboard data-clipboard-target="#foo">Copy to clipboard
var app = angular.module("mainApp", ['ngclipboard']);
For more information you can get from here : ngclipboard.js
I hope it can help you....
- AngularJS - How to render HTML value in ng-repeat ?
- AngularJS - scroll to a specific element using anchorscroll
- AngularJS - convert comma separated string to array example
- AngularJS - How to create read more/less toggle using Directive?
- Angularjs nl2br(textarea newline and linebreak conversion) example with demo
- AngularJS - how to remove html tags using filter?
- How to create Event for Mail sending in Laravel 5.2?
- How to add mysql trigger from migrations in Laravel 5?
- Codeigniter 3 - select2 ajax autocomplete from database example with demo
- Laravel 5 - GEO chart example and demo using lavacharts package
- Laravel 5 generate sitemap using roumen/sitemap package Example
- How to implement infinite ajax scroll pagination in Laravel 5?
- Laravel 5 - How to prevent browser back button after user logout?
- Laravel 5 - where condition with two columns example code