Monday, September 15, 2014

Update Angular model after setting input value with jQuery

I needed to update my angular model with jquery. But it doesn't seem work from default codes.

So I added following code to manually trigger the value after adding that from jquery.

angular.element($('myInputElement')).triggerHandler('input')

This perfectly worked except for hidden elements.

So I have to remove the hidden element and add it as text field and hide from style.

Ref:
http://stackoverflow.com/questions/17109850/update-angular-model-after-setting-input-value-with-jquery


No comments: