在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ HTML/ AngularJS表達(dá)式
AngularJS國(guó)際化
AngularJS表達(dá)式
AngularJS控制器
AngularJS MVC體系結(jié)構(gòu)
AngularJS表單
AngularJS服務(wù)
AngularJS作用域
AngularJS快速入門
AngularJS包括
AngularJS第一個(gè)應(yīng)用程序
AngularJS HTML DOM
AngularJS過(guò)濾器
AngularJS模塊
AngularJS Ajax
AngularJS自定義指令
AngularJS教程
AngularJS依賴注入
AngularJS表格
AngularJS指令
AngularJS環(huán)境設(shè)置
AngularJS視圖

AngularJS表達(dá)式

表達(dá)式用于應(yīng)用程序數(shù)據(jù)綁定到HTML。表達(dá)式都寫在雙括號(hào)就像{{表達(dá)式}}。表達(dá)式中的行為跟ng-bind指令方式相同。 AngularJS應(yīng)用表達(dá)式是純javascript表達(dá)式,并輸出它們被使用的數(shù)據(jù)在那里。

使用數(shù)字

<p>Expense on Books : {{cost * quantity}} Rs</p>

使用字符串

<p>Hello {{student.firstname + " " + student.lastname}}!</p>

使用對(duì)象

<p>Roll No: {{student.rollno}}</p>

使用數(shù)組

<p>Marks(Math): {{marks[3]}}</p>

例子

下面的例子將展示上述所有表達(dá)式。

testAngularJS.html 文件代碼如下:
<html>
<title>AngularJS Expressions</title>
<body>
<h1>Sample Application</h1>
<div ng-app="" ng-init="quantity=1;cost=30; student={firstname:'Mahesh',lastname:'Parashar',rollno:101};marks=[80,90,75,73,60]">
   <p>Hello {{student.firstname + " " + student.lastname}}!</p>   
   <p>Expense on Books : {{cost * quantity}} Rs</p>
   <p>Roll No: {{student.rollno}}</p>
   <p>Marks(Math): {{marks[3]}}</p>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
</body>
</html>

輸出

在Web瀏覽器打開(kāi)textAngularJS.html??吹浇Y(jié)果如下:


 


上一篇:AngularJS控制器下一篇:AngularJS表格