I am currently developing a custom directive that will need to handle the ngModelOptions
of an element. I have considered using a jQuery
selector to change the element's HTML, but I am curious if it can be done more consistently with JavaScript
.
UPDATE 1
Since I need to set
ngModelOptions="{updateOn:'blur'}
" for all input elements in my form, I would like to create a directive to accomplish this, similar to <input type='text' updateBlur/>
I am wondering if it is possible to set these options programmatically, such as:
myElement.attrs.ngModelOptions.updateOn = "blur default";