Skip to content
Related Articles

Related Articles

Improve Article

AngularJS | ng-cut Directive

  • Last Updated : 28 Mar, 2019
Geek Week

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.


<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>
    <title>ng-cut Directive</title>
    <script src=
<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">
        <pre>Cut status: {{iscut}}</pre>

Before cut the text element:
After cut the text element:

My Personal Notes arrow_drop_up
Recommended Articles
Page :