How to use the devextreme/core/dom_adapter.inject function in devextreme

To help you get started, we’ve selected a few devextreme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DevExpress / devextreme-angular / src / core / integration.ts View on Github external
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(() => {
                        return this.callBase.apply(this, args);
                    });
                }

                if (ngZone.isStable && insideZoneEvents.indexOf(eventName) !== -1) {
                    return ngZone.run(() => {
                        return this.callBase.apply(this, args);
                    });
                }