11 lines
349 B
TypeScript
11 lines
349 B
TypeScript
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
|
|
|
export function dispatchEvent(element: any, eventType: any) {
|
|
getDOM().dispatchEvent(element, getDOM().createEvent(eventType));
|
|
}
|
|
|
|
export function setInputValue(input: any, value: any) {
|
|
input.value = value;
|
|
dispatchEvent(input, 'input');
|
|
dispatchEvent(input, 'blur');
|
|
} |