国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

angular.js - Questions about angular's select
高洛峰
高洛峰 2017-05-15 17:10:37
0
1
630

js part:

$scope.sex = [{'name':'男', 'value':'man'},{'name':'女', 'value':'women'}];

html part:

<select ng-model="sexOptions" ng-options="x.value as x.name for x in sex">
    <option value="">請選擇</option>
</select>

The problem I am encountering now is:
I obtained the data results from the server. If the user's profile is "male", then this select must select the male item

This is how I bound it

$scope.sexOptions = {'value':res.farmersInfo.sex};

As shown below:

Binding can now be achieved, but when I select the option again, for example, I select the gender as female:
As shown below:

The problem arises, I selected female, but the default "Please select" is displayed

How to solve this problem?
Thank you everyone! ! ! !
Very anxious!

高洛峰
高洛峰

擁有18年軟件開發(fā)和IT教學(xué)經(jīng)驗(yàn)。曾任多家上市公司技術(shù)總監(jiān)、架構(gòu)師、項(xiàng)目經(jīng)理、高級(jí)軟件工程師等職務(wù)。 網(wǎng)絡(luò)人氣名人講師,...

reply all(1)
滿天的星座

<select ng-model="sexOptions.value"> try this?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template