Closed wioletag closed 6 years ago
The onChange is a field level change, if you want to watch the whole model then you would use a watch on your scope and trigger a function on the scope to make the change, which I would expect to cause a digest cycle. Or are you specifically wanting to trigger the onchange function in the form definition for the field? If so you may have to force it to run using something like these: https://stackoverflow.com/a/22942828/1383400
Please comment if you want to re-open or do not feel the question has been answered sufficiently.
I have onChange function defined in the form that works fine when I change inputs on the GUI. onChange: function(modelValue,form) { $scope.formOnChange(modelValue, form); }
However, I need to update model programmatically to display some values that are coming from backend call, and I thought that onChange function would fire on this update but it is not happening. I cannot figure it out. How do I trigger it? This is how I'm updating values: $scope.model[key] = newValue;
thanks