Introduction to ANGULARJS Basic Ng-cut instructions and simple examples _angularjs

Source: Internet
Author: User


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.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.