我有一个文本框,我想填充数据,但我不确定我的代码 这就是我所拥有的:
<td>
<select ng-show="field.fieldType.id==6" ng-model="field.relation.id">
<option value="null">----------</option>
<option ng-repeat="t in entities" value="{{t.id}}">
{{t.entityName}}
</option>
</select>
</td>
任何人都可以帮忙吗?
答案 0 :(得分:1)
请看一下 fiddle
<div ng-app="app">
<div ng-controller="ctrl">
<select>
<option ng-repeat="name in names" value="{{name}}">{{name}}</option>
</select>
</div>
</div>
JS
angular.module("app", [])
.controller("ctrl", function ($scope) {
$scope.names = ["mike", "angelo", "teresa"];
})