不知道什么是错的,任何线索的家伙?我发现使用ng-repeat,尝试ng-select并不能渲染任何东西都不好。
<select name="country" ng-model="user.country"
ng-options="country.name for country in country_list" >
{{name}}
</select>
$sope.country_list = [
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'}
];
答案 0 :(得分:0)
你有一个错字行6,$ scope不是$ sope
答案 1 :(得分:0)
你可以尝试:
<select ng-options="country as country.name for country in country_list" ></select>
答案 2 :(得分:0)
您有错误$scope
而非$sope
。见工作demo