diff --git a/modules/@angular/http/package.json b/modules/@angular/http/package.json index d849333b0c..d3af3f8c06 100644 --- a/modules/@angular/http/package.json +++ b/modules/@angular/http/package.json @@ -9,7 +9,9 @@ "license": "MIT", "peerDependencies": { "rxjs": "5.0.0-beta.6", - "@angular/core": "0.0.0-PLACEHOLDER" + "@angular/core": "0.0.0-PLACEHOLDER", + "@angular/common": "0.0.0-PLACEHOLDER", + "@angular/platform-browser": "0.0.0-PLACEHOLDER" }, "repository": { "type": "git", diff --git a/modules/@angular/http/src/backends/xhr_backend.ts b/modules/@angular/http/src/backends/xhr_backend.ts index d4c58e0d6b..181e8dabcc 100644 --- a/modules/@angular/http/src/backends/xhr_backend.ts +++ b/modules/@angular/http/src/backends/xhr_backend.ts @@ -1,4 +1,5 @@ -import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; +import {Injectable} from '@angular/core'; +import {__platform_browser_private__} from '@angular/platform-browser'; import {ConnectionBackend, Connection, XSRFStrategy} from '../interfaces'; import {ReadyState, RequestMethod, ResponseType, ContentType} from '../enums'; @@ -6,7 +7,6 @@ import {Request} from '../static_request'; import {Response} from '../static_response'; import {Headers} from '../headers'; import {ResponseOptions} from '../base_response_options'; -import {Injectable} from '@angular/core'; import {BrowserXhr} from './browser_xhr'; import {isPresent, isString} from '../../src/facade/lang'; import {Observable} from 'rxjs/Observable'; @@ -150,7 +150,7 @@ export class CookieXSRFStrategy implements XSRFStrategy { private _cookieName: string = 'XSRF-TOKEN', private _headerName: string = 'X-XSRF-TOKEN') {} configureRequest(req: Request) { - let xsrfToken = getDOM().getCookie(this._cookieName); + let xsrfToken = __platform_browser_private__.getDOM().getCookie(this._cookieName); if (xsrfToken && !req.headers.has(this._headerName)) { req.headers.set(this._headerName, xsrfToken); } diff --git a/modules/@angular/http/test/backends/xhr_backend_spec.ts b/modules/@angular/http/test/backends/xhr_backend_spec.ts index 301b488d80..662c5d9c9f 100644 --- a/modules/@angular/http/test/backends/xhr_backend_spec.ts +++ b/modules/@angular/http/test/backends/xhr_backend_spec.ts @@ -15,7 +15,7 @@ import {BrowserXhr} from '../../src/backends/browser_xhr'; import {XSRFStrategy} from '../../src/interfaces'; import {XHRConnection, XHRBackend, CookieXSRFStrategy} from '../../src/backends/xhr_backend'; import {provide, Injector, Injectable, ReflectiveInjector} from '@angular/core'; -import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; +import {__platform_browser_private__} from '@angular/platform-browser'; import {Request} from '../../src/static_request'; import {Response} from '../../src/static_response'; import {Headers} from '../../src/headers'; @@ -118,6 +118,7 @@ export function main() { () => { expect(() => backend.createConnection(sampleRequest)).not.toThrow(); }); }); + const getDOM = __platform_browser_private__.getDOM; if (getDOM().supportsCookies()) { describe('XSRF support', () => { it('sets an XSRF header by default', () => { diff --git a/modules/@angular/http/tsconfig-es2015.json b/modules/@angular/http/tsconfig-es2015.json index fc62b849ee..f11638fb7b 100644 --- a/modules/@angular/http/tsconfig-es2015.json +++ b/modules/@angular/http/tsconfig-es2015.json @@ -12,7 +12,9 @@ "moduleResolution": "node", "outDir": "../../../dist/packages-dist/http/esm", "paths": { - "@angular/core": ["../../../dist/packages-dist/core"] + "@angular/core": ["../../../dist/packages-dist/core"], + "@angular/common": ["../../../dist/packages-dist/common"], + "@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"] }, "rootDir": ".", "sourceMap": true, diff --git a/modules/@angular/http/tsconfig-es5.json b/modules/@angular/http/tsconfig-es5.json index 009d0eea2d..43f06c4c88 100644 --- a/modules/@angular/http/tsconfig-es5.json +++ b/modules/@angular/http/tsconfig-es5.json @@ -12,7 +12,9 @@ "moduleResolution": "node", "outDir": "../../../dist/packages-dist/http/", "paths": { - "@angular/core": ["../../../dist/packages-dist/core"] + "@angular/core": ["../../../dist/packages-dist/core"], + "@angular/common": ["../../../dist/packages-dist/common"], + "@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"] }, "rootDir": ".", "sourceMap": true,