How to use the devextreme/core/http_request.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 / http-request.ts View on Github external
constructor(xhrFactory: XhrFactory) {
        httpRequest.inject({
            getXhr: function() {
                let _xhr = xhrFactory.build();
                if (!('withCredentials' in _xhr)) {
                    _xhr['withCredentials'] = false;
                }

                return _xhr;
            }
        });
    }
}
github DevExpress / devextreme-angular / src / core / integration.ts View on Github external
},

            isElementNode: function(element) {
                return element && element.nodeType === 1;
            },

            isTextNode: function(element) {
                return element && element.nodeType === 3;
            },

            isDocument: function(element) {
                return element && element.nodeType === 9;
            }
        });

        httpRequest.inject({
            getXhr: function() {
                if (!xhrFactory) {
                    return this.callBase.apply(this);
                }
                let _xhr = xhrFactory.build();
                if (!('withCredentials' in _xhr)) {
                    _xhr['withCredentials'] = false;
                }

                return _xhr;
            }
        });

        ngZone.run(() => {
            eventsEngine.set({});
            callbacks.forEach(callback => originalAdd.call(null, callback));