0
在這種codepen我attemptling從範圍變量加載選項元素填充所有選項:不受NG-選項
<html>
<head>
<title>AngularJS test</title>
</head>
<body ng-app ng-controller="TestCtrl">
<select ng-init="vendor = vendors[0]" ng-model="vendor" ng-options="vendorName as vendor.name for vendorName in vendors"></select>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
</body>
</html>
function TestCtrl($scope) {
$scope.vendors = [{
name: 'Oracle1',
name: 'Oracle2'
}];
}
但是,僅僅在位置[1]該元件正被加載。
CodePen:http://codepen.io/anon/pen/OVbXJV?editors=101
爲什麼只是1選項元素加載?