AngularJS – ng-copy Directive

The ng-copy Directive in AngularJS is used for specifying any custom behaviour while copying the texts in input text fields. We can use this directive to call certain methods that will be triggered while the text is copied from the input field. This directive is supported by all types of input elements.

Syntax

..content..

Example − ngCopy Directive

Create a file "ngCopy.html" in your Angular project directory and copy-paste the following code snippet.


   
      ngCopy Directive

      

      
   

   
      

         Welcome to Tutorials Point      

     

         AngularJS | ngCopy Directive      

     
                   
         
Copied status: {{isCopy}}
     

Output

To run the above code, just go to your file and run it as a normal HTML file. You will see the following output on the browser window.

Updated on: 2021-10-08T12:53:46+05:30

345 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements