English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

AngularJS ng-cut instruction

AngularJS Reference Manual

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
<input ng-cut="count = count" + 1" ng-init="count=0" value="Cut this text" />
<p>The text has been cut {{count}} times.</p>
<p>In the example, the count variable "count" is automatically incremented after each cut. 1。</p>
</body>
</html>
Test to see ‹/›

Definition and Usage

ng-cut The directive is used to tell AngularJS what operation needs to be performed when cutting the text of HTML elements.

ng-cut The directive does not override the original oncut event of the element, when the event is triggered,ng-cut Both the expression and the original oncut event will be executed.

Syntax

   <element ng-cut="expression"></element>

<a>, <input>, <select>, <textarea>, and window objects all support this directive.

Parameter Value

ValueDescription
expressionThe expression to be executed when the element text is cut.

AngularJS Reference Manual