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