Improve this Doc View Source browserTrigger

From Get docs
< Improve this Doc ngMock‎ | functionAngularjs/docs/1.8/api/ngmock/function/browsertrigger

Improve this Doc View Source browserTrigger

  1. function in module ngMock


This is a global (window) function that is only available when the ngMock module is included.

It can be used to trigger a native browser event on an element, which is useful for unit testing.


browserTrigger(element, [eventType], [eventData]);


Param Type Details
element Object Either a wrapped jQuery/jqLite node or a DOMElement



string Optional event type. If none is specified, the function tries to determine the right event type for the element, e.g. change for input[text].




An optional object which contains additional event data that is used when creating the event:

© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.