JavaScript Intensive Tutorial--angularjs expressions

Source: Internet
Author: User

This article ish5eduAgency officialHTML5 Trainingtutorials, the main introduction:JavaScript Intensive TutorialsJavaScript Intensive tutorial--angularjs expressions
 
AngularJS UseAn expressionbind the data to HTML. AngularJS-expression
AngularJS expressions are written in double curly braces:{{expression}}.
The AngularJS expression binds the data to HTML, whichNg-binddirectives have the same similarities.
AngularJS will "output" the data where the expression is written.
AngularJS-expressionmuch likeJavaScript Expressions: They can contain literals, operators, and variables.
instance {{5 + 5}} or {{firstName + "" + LastName}}
AngularJS Instances
<! DOCTYPE html>


<meta charset= "Utf-8" >
<script src= "Http://apps.bdimg.com/libs/ang ... gt%3b

<body>

<div ng-app= "" >
<p> My first expression: {{5 + 5}}</p>
</div>

</body>

AngularJS Digital
AngularJS numbers are like JavaScript numbers:
AngularJS Instances
<div ng-app= "" ng-init= "quantity=1;cost=5" >

<p> Total Price: {{quantity * cost}}</p>

</div>
 
Use the same instance of Ng-bind:
AngularJS Instances
<div ng-app= "" ng-init= "quantity=1;cost=5" >

<p> Total Price: <span ng-bind= "quantity * cost" ></span></p>

</div>

Click to enter JavaScript intensive tutorial

This article is from the "11721999" blog, please be sure to keep this source http://11731999.blog.51cto.com/11721999/1843748

JavaScript Intensive Tutorial--angularjs expressions

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.