AngularJS ng-cut Directive Last Updated : 08 Aug, 2022 Comments Improve Suggest changes Like Article Like Report 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 that 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>Parameter: expression: It specifies what to do when the input is cut. Example 1: This example uses the ng-cut Directive to display a message when cutting the input text element. HTML <!DOCTYPE html> <html> <head> <title>ng-cut Directive</title> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"> </script> <style> body { text-align: center; font-family: sans-serif; } h1 { color: green; } </style> </head> <body ng-app style="text-align:center"> <h1>GeeksforGeeks</h1> <h3>ng-cut Directive</h3> <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: Example 2: This example implements the ng-cut Directive to display the number of times the message cuts from the input text element. HTML <!DOCTYPE html> <html> <head> <title>ng-cut Directive</title> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"> </script> <style> body { text-align: center; font-family: sans-serif; } h1 { color: green; } </style> </head> <body ng-app=""> <h1>GeeksforGeeks</h1> <h3>ng-cut Directive</h3> <p>Cut the "GeeksforGeeks" text</p> <input ng-cut="cut = cut + 1" ng-init="cut=0" value="GeeksforGeeks" /> <p> {{cut}} times text cut.</p> </body> </html> Output: Comment More infoAdvertise with us Next Article AngularJS ng-cut Directive V Vishal Chaudhary 2 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Directives Similar Reads AngularJS ng-copy Directive The ng-copy Directive in AngularJS is used to specify the custom behavior functions during the copy of the text in input text fields. It can be used when we want to call a function that will be triggered when the text is copied from the input field. It is supported by all input elements. The element 2 min read AngularJS ng-app Directive The ng-app Directive in AngularJS is used to define the root element of an AngularJS application. This directive automatically initializes the AngularJS application on page load. It can be used to load various modules in AngularJS applications. The ng-app directive declares only once in the HTML doc 1 min read AngularJS ng-change Directive The ng-change Directive in AngularJS is used whenever the value of an input element changes. The expression is evaluated immediately whenever there is a change in the input value. It requires an ng-model directive to be present. It is triggered whenever there is any single change in the input. It ca 2 min read AngularJS ng-if Directive The ng-if Directive in AngularJS is used to remove or recreate a portion of the HTML element based on an expression. The ng-if is different from the ng-hide directive because it completely removes the element in the DOM rather than just hiding the display of the element. If the expression inside it 2 min read AngularJS ng-src Directive The ng-src Directive in AngularJS is used to specify the src attribute of an <img> element, ie., it overrides the original src attribute for an <img> element. This attribute must be used if we have the Angular code inside of the src element. It ensures that the wrong image is not produce 2 min read Like