I want to make a google chrome extension that fills some text inputs in a
website that uses Angular. Each text input takes some action on "focus",
"keydown" and "blur". These events are added using some Angular
directives(?). Here's one of the input elements that I want to fill in the
page:
<input id="input-1" data-ng-keydown="keyDown(cell, $event,$
parent.$parent.$index, $index)"
data-ng-focus="cellEnter($event, cell)" data-ng-blur="cellLeave($event, cell)"
data-ng-disabled="timesheet.ReadOnly"
data-ng-model="cell.S_Minutes" class="cellInput ng-valid ng-dirty"
type="text" style="margin-top:4px" maxlength="5">
There are three directives that are interesting to me
data-ng-focus="cellEnter($event, cell)"
data-ng-blur="cellLeave($event, cell)"
data-ng-keydown="keyDown(cell, $event,$ parent.$parent.$index, $index)"
I want to set the value of this input to a value and trigger all the events
above. But I don't know How. If it was pure JS i could do something like
the following but it does not work here. Please note that as I said I
cannot change the logic of the website, I'm developing a chrome extension.
el=document.getElementById('input-1');var evt = new KeyboardEvent('keydown');
el.value="1";
el.dispatchEvent(evt);
Please excuse me if my question seems stupid, I'm in an intermediate level
in JS and know almost nothing about Angular. Any help is highly appreciated.
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.