AngularJS overrides ng-model-options updateOn submit

I have an input field that will update the corresponding model when the form is submitted with ng-model-options="{updateOn: 'submit'}"

However, I have cases where I need to update the model before submitting. Is there a way to reverse this delay and force the model to update without having to programmatically submit the form?

+3


source to share


1 answer


$ commitViewValue () sort this:



$scope.myForm.myFieldName.$commitViewValue();

      

+3


source







All Articles