AngularJS | ng-cut Directive
The ng-cut Directive in AngularJS is used to specify the custom behavior functions when the text in input fields is cut. It can be used when we want to call a function which will be triggered when the text is cut from the input field. It is supported by all input elements.
Syntax:
<element ng-cut="expression"> Contents... </element>
Where expression tells what to do when the input is cut.
Example: This example uses ng-cut Directive to display message when cut the input text element.
<!DOCTYPE html> <html> <head> <title>ng-cut Directive</title> <script src= </script> </head> <body ng-app style="text-align:center"> <h1 style="color:green">GeeksforGeeks</h1> <h2>ng-cut Directive</h2> <div ng-init="iscut=false;cut='Cut this text!'"> <textarea ng-cut="iscut=true" ng-model="cut"> </textarea> <br> <pre>Cut status: {{iscut}}</pre> </div> </body> </html> |
Output:
Before cut the text element:

After cut the text element:

Recommended Posts:
- AngularJS | ng-if Directive
- AngularJS | ng-value Directive
- AngularJS | ng-src Directive
- AngularJS | ng-csp Directive
- AngularJS | ng-app Directive
- AngularJS | Directive
- AngularJS | ng-jq Directive
- AngularJS | ng-required Directive
- AngularJS | ng-submit Directive
- AngularJS | ng-srcset Directive
- AngularJS | ng-style Directive
- AngularJS | ng-bind Directive
- AngularJS | ng-paste Directive
- AngularJS | ng-selected Directive
- AngularJS | ng-open Directive
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



