Javascript 安格拉斯<;数据列表>;给出奇怪的选择
我正在尝试转换以下内容:Javascript 安格拉斯<;数据列表>;给出奇怪的选择,javascript,angularjs,html-datalist,Javascript,Angularjs,Html Datalist,我正在尝试转换以下内容: <td class="col-md-2"> <select style="max-width:120px" ng-model="row.gaProfileId" ng-repeat="profile.id as weGaAdminCtrl.showProfile(profile) for profile in weGaAdminCtrl.profiles" ng-change="weGaAdminCt
<td class="col-md-2">
<select style="max-width:120px"
ng-model="row.gaProfileId"
ng-repeat="profile.id as weGaAdminCtrl.showProfile(profile) for profile in weGaAdminCtrl.profiles"
ng-change="weGaAdminCtrl.assignBrandToProfile(row)">
</select>
</td>
变成这样:
<td class="col-md-2">
<input type="text" list="datalist">
<datalist id="datalist">
<select style="max-width:120px;"
ng-model='row.gaProfileId'
ng-options='profile.id as weGaAdminCtrl.showProfile(profile) for profile in weGaAdminCtrl.profiles'
ng-change="weGaAdminCtrl.assignBrandToProfile(row)">
</select>
</datalist>
</td>
我得到的是:
现在我不明白的是它如何给我“字符串:####”。有人知道我如何更改此设置吗?html:
从角度为1.x的数据列表中触发ng更改,读取和
由于样式设置数据列表
和选择
请参见
<div ng-controller="MyCtrl">
<input list="trees" name ="trees">
<datalist id="trees">
//<select> is optional
<option ng-repeat="tree in trees" value="{{tree.name}}">{{tree.name}}</option>
//</select>
</datalist>
</div>
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.trees = [
{'name':'oak'},
{'name':'ash'},
{'name':'fir'}
];
}