亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

AngularJS基礎(chǔ) ng-options 指令詳解

 更新時間:2016年08月02日 15:43:24   投稿:lqh  
本文主要介紹AngularJS ng-options 指令,這里對ng-options指令的知識做了詳細(xì)整理,并附有詳細(xì)的代碼示例,有需要的小伙伴可以參考下

AngularJS ng-options 指令

AngularJS 實(shí)例

使用數(shù)組元素填充下拉列表:

<!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>

<div ng-app="myApp" ng-controller="myCtrl">

<select ng-model="selectedName" ng-options="item for item in names">
</select>

</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
  $scope.names = ["Emil", "Tobias", "Linus"];
});
</script>

<p>該實(shí)例演示了如何使用 ng-options 指令填充下拉列表。</p>

</body>
</html>

定義和用法

ng-options 指令用于使用 <options> 填充 <select> 元素的選項(xiàng)。

ng-options 指令使用數(shù)組來填充下拉列表,多數(shù)情況下與 ng-repeat 指令一起使用。

語法

<select ng-options="array expression"></select>

<details> 元素支持該指令。

參數(shù)值

描述
array expression 數(shù)組中為 select 元素填充選項(xiàng)的表達(dá)式。

以上就是對AngularJS ng-options資料的整理,后續(xù)繼續(xù)補(bǔ)充。

相關(guān)文章

最新評論