Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { NgModule, Inject, NgZone, Optional } from '@angular/core';
import { XhrFactory } from '@angular/common/http';
import * as httpRequest from 'devextreme/core/http_request';
import { DOCUMENT } from '@angular/common';
import * as domAdapter from 'devextreme/core/dom_adapter';
import * as readyCallbacks from 'devextreme/core/utils/ready_callbacks';
import * as eventsEngine from 'devextreme/events/core/events_engine';
const outsideZoneEvents = ['mousemove', 'mouseover', 'mouseout'];
const insideZoneEvents = ['mouseup', 'click', 'mousedown', 'transitionend', 'wheel'];
let originalAdd;
let callbacks = [];
readyCallbacks.inject({
add: function(callback) {
originalAdd = this.callBase.bind(this);
callbacks.push(callback);
}
});
@NgModule({})
export class DxIntegrationModule {
constructor(@Inject(DOCUMENT) document: any, ngZone: NgZone, @Optional() xhrFactory: XhrFactory) {
domAdapter.inject({
_document: document,
listen: function(...args) {
const eventName = args[1];
if (outsideZoneEvents.indexOf(eventName) !== -1) {
return ngZone.runOutsideAngular(() => {