Am using ng-options
to populate dropdown list, There are 3 dropdowns which are dependent on each other. If I select a particular option in Dropdown1, the other two drpdowns should appear. Then, if I select some values in that two dropdowns and without saving am changing the value in 1st dropdown the 2 dropdowns should get disappeared. Now the problem is that if I re-select the same option in Dropdown1 the values which I have selected previously are not refreshed.
<li class="col-sm-3">
<p>Reason<b>*</b></p>
<p>
<select data-ng-model="note.reason" data-ng-options="option as option.value for option in reasons">
<option style="display:none" data-ng-model="note.reason" value="">Select Reason</option>
</select>
</p>
</li>
<li class="col-sm-3" ng-show="note.reason.value=='Intervention'">
<p>Category<b>*</b></p>
<p>
<select data-ng-model="note.category" ng-if ="note.reason" data-ng-options="option as option.value for option in categories">
<option style="display:none" selected="selected" value="">Select Category</option>
</select>
</p>
</li>
<li class="col-sm-3" ng-show="note.reason.value=='Intervention'">
<p>Tone<b>*</b></p>
<p>
<select data-ng-model="note.tone" ng-if ="note.reason" data-ng-options="option as option.value for option in tones">
<option style="display:none" value="">Select Tone</option>
</select>
</p>
</li>
I am using ng-if
to do the same, earlier it was working properly when data-ng-model="reason"
, when data-ng-model
is changed to note.reason
, ng-if
stopped working. Can you explain to me the problem in Detail.