ng-change
is not getting fired after selection of previously selected option.
Because of which I am not able to handle the same next selection.
<select ng-model="selectedOption" ng-change="handleSelection()">
<option value="A" selected>A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
I want to show to the user the last selected option and want to handle the same.
But since ng-model
is not changing on next same option selection ng-change
is not getting fired.
How to handle this scenario?
You can do without
ng-change
by only checking click count:1st
click event
raises after each openingselect
2nd
click event
raises after one item selectedwe use
blur event
to clear click count after lost focusby this way you will get selected item without
change event
andwithout selecting new item
:--