I am currently using ui.select2 for dropdown menus.
Situation: I have an ajax request that retrieves dropdown values.
document.dropDownDocStatuses = [
{ key: 0, value: 'All active (' + response.totalDocuments + ')' },
{ key: 1, value: 'Draft (' + response.draft + ')' }
];
In my HTML code:
<select ui-select2 class="form-control font-12px input-style3 "
ng-model="document.dropDownDocStatus"
ng-change="document.filterDocuments()">
<option ng-repeat="documents in document.dropDownDocStatuses" value="{{documents.key}}">({{documents.value}})</option> </select>
The user has selected a value.
Problem: After updating the value of any dropdown option using:
_document.dropDownDocStatuses[_document.dropDownDocStatus].value++;
_document.dropDownDocStatuses[1].value++;
The value is updated but the selected value text does not change. However, clicking on the dropdown reveals the updated value.
Can anyone provide guidance on how to resolve this issue? Any assistance would be greatly appreciated.