X Tutup
Skip to content

Commit ad6fb06

Browse files
committed
fix(dart): fix the static_browser platform not to include compiler
Closes #5321
1 parent c03fb36 commit ad6fb06

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

modules/angular2/platform/browser.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ import {
1010
import {COMPILER_PROVIDERS} from 'angular2/compiler';
1111
import {ComponentRef, platform, reflector} from 'angular2/core';
1212
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
13+
import {XHRImpl} from "angular2/src/platform/browser/xhr_impl";
14+
import {XHR} from 'angular2/compiler';
15+
import {Provider} from 'angular2/src/core/di';
1316

1417
/**
1518
* An array of providers that should be passed into `application()` when bootstrapping a component.
1619
*/
17-
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
18-
CONST_EXPR([BROWSER_APP_COMMON_PROVIDERS, COMPILER_PROVIDERS]);
20+
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
21+
BROWSER_APP_COMMON_PROVIDERS,
22+
COMPILER_PROVIDERS,
23+
new Provider(XHR, {useClass: XHRImpl}),
24+
]);
1925

2026
/**
2127
* Bootstrapping for Angular applications.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Promise} from 'angular2/src/facade/async';
22

3-
// TODO: vsavkin rename it into TemplateLoader and do not reexport it via DomAdapter
3+
// TODO: vsavkin rename it into TemplateLoader
44
export class XHR {
55
get(url: string): Promise<string> { return null; }
66
}

modules/angular2/src/platform/browser/xhr_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ library angular2.src.services.xhr_impl;
33
import 'dart:async' show Future;
44
import 'dart:html' show HttpRequest;
55
import 'package:angular2/core.dart';
6-
import 'package:angular2/compiler.dart' show XHR;
6+
import 'package:angular2/src/compiler/xhr.dart';
77

88
@Injectable()
99
class XHRImpl extends XHR {

modules/angular2/src/platform/browser_common.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {CONST_EXPR} from 'angular2/src/facade/lang';
22
import {provide, Provider, Injector, OpaqueToken} from 'angular2/src/core/di';
33

4-
import {XHR} from 'angular2/compiler';
54
import {
65
PLATFORM_DIRECTIVES,
76
PLATFORM_PIPES,
@@ -15,7 +14,6 @@ import {
1514
} from "angular2/core";
1615
import {COMMON_DIRECTIVES, COMMON_PIPES, FORM_PROVIDERS} from "angular2/common";
1716
import {Renderer} from 'angular2/render';
18-
import {XHRImpl} from "angular2/src/platform/browser/xhr_impl";
1917
import {Testability} from 'angular2/src/core/testability/testability';
2018

2119
// TODO change these imports once dom_adapter is moved out of core
@@ -60,7 +58,6 @@ export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/
6058
new Provider(DomRenderer, {useClass: DomRenderer_}),
6159
new Provider(Renderer, {useExisting: DomRenderer}),
6260
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
63-
new Provider(XHR, {useClass: XHRImpl}),
6461
DomSharedStylesHost,
6562
Testability,
6663
BrowserDetails,

0 commit comments

Comments
 (0)
X Tutup