Seeking clarification on the correct usage of AngularJS's ng-change
and ng-blur
from an expert. Specifically, when updating a form value.
- In the code snippet below, I have a dropdown where I would like to trigger
overrideBusinessDec()
when the user changes the dropdown selection. However, due tong-blur
, the function is currently being called when clicking away from the form. Removingng-blur
resolves this issue temporarily. - Another situation arises during editing, the form values are populated but the form remains disabled unless
ng-blur
is added. How can I address this?
Is there a universal solution to tackle both issues?
<!-- main.html -->
<div>
<select kendo-drop-down-list k-data-value-field="'id'"
k-data-text-field="'text'" k-option-label="'Select'"
k-data-source="ctrlEffOptions"
ng-disabled="!processRating.controlEffectivenessRatingComputeKey"
ng-model="processRating.controlEffectivenessRatingOverrideKey"
ng-change="overrideBusinessDec()" id="controlEffBusiness" required ng-model-options="{updateOn: 'blur'}">
</select>
</div>