Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions modules/angular2/platform/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any /*Type | Provider | any[]*/> =
CONST_EXPR([BROWSER_APP_COMMON_PROVIDERS, COMPILER_PROVIDERS]);
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = CONST_EXPR([
BROWSER_APP_COMMON_PROVIDERS,
COMPILER_PROVIDERS,
new Provider(XHR, {useClass: XHRImpl}),
]);

/**
* Bootstrapping for Angular applications.
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/compiler/xhr.ts
Original file line number Diff line number Diff line change
@@ -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<string> { return null; }
}
2 changes: 1 addition & 1 deletion modules/angular2/src/platform/browser/xhr_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions modules/angular2/src/platform/browser_common.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -60,7 +58,6 @@ export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/
new Provider(DomRenderer, {useClass: DomRenderer_}),
new Provider(Renderer, {useExisting: DomRenderer}),
new Provider(SharedStylesHost, {useExisting: DomSharedStylesHost}),
new Provider(XHR, {useClass: XHRImpl}),
DomSharedStylesHost,
Testability,
BrowserDetails,
Expand Down