You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Http service throws error 'XMLHttpRequest is not defined' #14
I am trying to build an app that hits a particular server and displays the data. When injecting and using the Http service I get an error a mile long. The gist of it is:
EXCEPTION: Error during instantiation of App!.
ORIGINAL EXCEPTION: ReferenceError: XMLHttpRequest is not defined
ORIGINAL STACKTRACE:
ReferenceError: XMLHttpRequest is not defined
at BrowserXhr.build (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/http/backends/browser_xhr.js:19:60)
at Observable._subscribe (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/http/backends/xhr_backend.js:32:35)
at Observable.subscribe (/Users/mckeowr/Documents/git/angular-electron/node_modules/rxjs/Observable.js:58:33)
at new App (/Users/mckeowr/Documents/git/angular-electron/demo/component.js:17:14)
at /Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/core/reflection/reflection_capabilities.js:13:47
at Injector._instantiate (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/core/di/injector.js:777:27)
at Injector._instantiateProvider (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/core/di/injector.js:715:25)
at Injector._new (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/core/di/injector.js:704:21)
at InjectorInlineStrategy.instantiateProvider (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/core/di/injector.js:204:30)
at ElementDirectiveInlineStrategy.init (/Users/mckeowr/Documents/git/angular-electron/node_modules/angular2/src/core/linker/element.js:558:24)
I started from the demo code and just changed the "component.ts" file as shown here:
I am trying to build an app that hits a particular server and displays the data. When injecting and using the Http service I get an error a mile long. The gist of it is:
I started from the demo code and just changed the "component.ts" file as shown here:
It seems that maybe the code is running in the main process and not the renderer process which results in a problem with browser_xhr?