Im writing in the hope of figuring out how to call angularJS to update its model when doing autocomplete from browser extensions. I know that some other applications (password managers like LastPass) do this successfully.
I am creating a small Safari extension that will help me fill out the Apple form completely (funny). Sandbox. A user creation form that has 10 input fields and a couple of selector elements.
So far, I have managed to get input fields using jQuery and set their value using .val() . However, this does not cause angularJS to update its model, therefore, despite the presence of text in the input fields, angular believes that the text is missing and the form cannot be verified.
The problem can be easily fixed if I can access the angular object, but I seem to be unable to do this. My script input returns undefined when I try to access angular . So Im thinking that Im was either looking for the angular object incorrectly, or I have to solve it differently.
To note that I have already tried some other tricks mentioned on the Internet: input.trigger('input'); and other similar materials.
source share