Angularjs ng-cut Instruction
Angularjs instance
Executes an expression when the text of the input box is cut:
<! DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<script src = "http://apps.bdimg.com/libs/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> The count variable "count" in the example automatically increases by 1 after each cut. </ p>
</ body>
</ html>
Note: The count variable "count" in an instance automatically increases by 1 after each cut.
Definitions and usage
The ng-cut directive is used to tell angularjs what needs to be done to cut the text of an HTML element.
The ng-cut instruction instruction does not overwrite the original oncut event of the element, and the ng-cut expression and the original Oncut event are executed when the event is triggered.
Grammar
<element ng-cut= "expression" ></element>
<a>, <input>, <select>, <textarea>, and Window objects support the directive.
Parameter values
value |
Description |
Expression |
An expression that is executed when the element text is cut. |
The above is the Angularjs ng-cut instructions of the data collation, hope to help programming angular students.