尝试使用AngularJS和ng-options的最新版本(1.5.8)来填充下拉列表.
问题是它正在添加数据类型以及值,如下所示:
<select class="possedetail ng-valid ng-dirty ng-valid-parse ng-touched" ng-model="Province" ng-options="p as p for p in provList"> <option value="string:ALBERTA" label="ALBERTA">ALBERTA</option> <option value="string:BRITISH COLUMBIA" label="BRITISH COLUMBIA">BRITISH COLUMBIA</option></select>
我需要字符串:艾伯塔省……
这是我的数据来源:
$scope.provList = ["ALBERTA","BRITISH COLUMBIA","MANITOBA","NEW BRUNSWICK","NEWFOUNDLAND AND LABRADOR","NORTHWEST TERRITORIES","NOVA SCOTIA","NUNAVUT","ONTARIO","PRINCE EDWARD ISLAND","QUEBEC","SASKATCHEWAN","YUKON",];
我已阅读google文档,在网上搜索并尝试将我的数据源格式更改为[{name:“Alberta”},{name:“BC”}] …
请帮忙,不管怎么说?