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
- function in module ngMock
Overview
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.
Usage
browserTrigger(element, [eventType], [eventData]);
Arguments
Param | Type | Details |
---|---|---|
element | Object
|
Either a wrapped jQuery/jqLite node or a DOMElement |
eventType (optional) |
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] .
|
eventData (optional) |
Object
|
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.
https://code.angularjs.org/1.8.2/docs/api/ngMock/function/browserTrigger