From ad6fb067e9dc1c52314f9002947045c370ecd851 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Mon, 16 Nov 2015 13:58:24 -0800 Subject: [PATCH] fix(dart): fix the static_browser platform not to include compiler Closes #5321 --- modules/angular2/platform/browser.ts | 10 ++++++++-- modules/angular2/src/compiler/xhr.ts | 2 +- modules/angular2/src/platform/browser/xhr_impl.dart | 2 +- modules/angular2/src/platform/browser_common.ts | 3 --- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/angular2/platform/browser.ts b/modules/angular2/platform/browser.ts index 67ff53b234..992d0777d2 100644 --- a/modules/angular2/platform/browser.ts +++ b/modules/angular2/platform/browser.ts @@ -10,12 +10,18 @@ import { import {COMPILER_PROVIDERS} from 'angular2/compiler'; import {ComponentRef, platform, reflector} from 'angular2/core'; import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities'; +import {XHRImpl} from "angular2/src/platform/browser/xhr_impl"; +import {XHR} from 'angular2/compiler'; +import {Provider} from 'angular2/src/core/di'; /** * An array of providers that should be passed into `application()` when bootstrapping a component. */ -export const BROWSER_APP_PROVIDERS: Array = - CONST_EXPR([BROWSER_APP_COMMON_PROVIDERS, COMPILER_PROVIDERS]); +export const BROWSER_APP_PROVIDERS: Array = CONST_EXPR([ + BROWSER_APP_COMMON_PROVIDERS, + COMPILER_PROVIDERS, + new Provider(XHR, {useClass: XHRImpl}), +]); /** * Bootstrapping for Angular applications. diff --git a/modules/angular2/src/compiler/xhr.ts b/modules/angular2/src/compiler/xhr.ts index 1f500e2c6c..43253a7295 100644 --- a/modules/angular2/src/compiler/xhr.ts +++ b/modules/angular2/src/compiler/xhr.ts @@ -1,6 +1,6 @@ import {Promise} from 'angular2/src/facade/async'; -// TODO: vsavkin rename it into TemplateLoader and do not reexport it via DomAdapter +// TODO: vsavkin rename it into TemplateLoader export class XHR { get(url: string): Promise { return null; } } diff --git a/modules/angular2/src/platform/browser/xhr_impl.dart b/modules/angular2/src/platform/browser/xhr_impl.dart index 988e331973..aa81ac6463 100644 --- a/modules/angular2/src/platform/browser/xhr_impl.dart +++ b/modules/angular2/src/platform/browser/xhr_impl.dart @@ -3,7 +3,7 @@ library angular2.src.services.xhr_impl; import 'dart:async' show Future; import 'dart:html' show HttpRequest; import 'package:angular2/core.dart'; -import 'package:angular2/compiler.dart' show XHR; +import 'package:angular2/src/compiler/xhr.dart'; @Injectable() class XHRImpl extends XHR { diff --git a/modules/angular2/src/platform/browser_common.ts b/modules/angular2/src/platform/browser_common.ts index e3320a7acc..fc33b5b0b9 100644 --- a/modules/angular2/src/platform/browser_common.ts +++ b/modules/angular2/src/platform/browser_common.ts @@ -1,7 +1,6 @@ import {CONST_EXPR} from 'angular2/src/facade/lang'; import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di'; -import {XHR} from 'angular2/compiler'; import { PLATFORM_DIRECTIVES, PLATFORM_PIPES, @@ -15,7 +14,6 @@ import { } from "angular2/core"; import {COMMON_DIRECTIVES, COMMON_PIPES, FORM_PROVIDERS} from "angular2/common"; import {Renderer} from 'angular2/render'; -import {XHRImpl} from "angular2/src/platform/browser/xhr_impl"; import {Testability} from 'angular2/src/core/testability/testability'; // TODO change these imports once dom_adapter is moved out of core @@ -60,7 +58,6 @@ export const BROWSER_APP_COMMON_PROVIDERS: Array