javascript - Ionic Form Can't Change Option on Select -


i trying create form in ionic, including dropdown list. previously, had following code:

            <label class="item item-input item-select">                 <span class="input-label">* age</span>                 <select ng-model="data.child1.age" required>                     <option ng-value="7">year 7 (11-12)</option>                     <option ng-value="8">year 8 (12-13)</option>                     <option ng-value="9">year 9 (13-14)</option>                     <option ng-value="10">year 10 (14-15)</option>                     <option ng-value="11">year 11 (15-16)</option>                     <option ng-value="12">year 12 (16-17)</option>                     <option ng-value="13">year 13 (17-18)</option>                 </select>             </label> 

the problem when loaded in saved data (from db), view not update match model.

so, after research, tried instead:

            <label class="item item-input item-select">                 <span class="input-label">* age</span>                 <select ng-model="data.child1.age" ng-options="item.id item.label item in ageoptions" required></select>             </label> 

where ageoptions looks this:

             $scope.ageoptions = [                 {id: 7, label: "year 7 (11-12)"},                 {id: 8, label: "year 8 (12-13)"},                 {id: 9, label: "year 9 (13-14)"},                 {id: 10, label: "year 10 (14-15)"},                 {id: 11, label: "year 11 (15-16)"},                 {id: 12, label: "year 12 (16-17)"},                 {id: 13, label: "year 13 (17-18)"}              ]   

however, although view updates fine , matches model, can't change selected option! more specifically, clicking on form element doesn't (ie open dropdown box).

i have looked around bit couldn't find on this. help!


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -