From 8667b760f4762874c29ed615ced5312b2880a762 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Sun, 11 Oct 2015 13:17:06 +0200 Subject: [PATCH] refactor(router): use DI imports from public API This allows us to create smaller CJS bundles for router, where the bundle doesn't duplicate code from angular2 core. --- modules/angular2/router.ts | 2 +- modules/angular2/src/router/hash_location_strategy.ts | 2 +- modules/angular2/src/router/location.ts | 2 +- modules/angular2/src/router/path_location_strategy.ts | 2 +- modules/angular2/src/router/route_data.ts | 2 +- modules/angular2/src/router/route_registry.ts | 2 +- modules/angular2/src/router/router_outlet.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/angular2/router.ts b/modules/angular2/router.ts index 17dc9c8ad4..63254fec5e 100644 --- a/modules/angular2/router.ts +++ b/modules/angular2/router.ts @@ -28,7 +28,7 @@ import {RouterOutlet} from './src/router/router_outlet'; import {RouterLink} from './src/router/router_link'; import {RouteRegistry} from './src/router/route_registry'; import {Location} from './src/router/location'; -import {provide, OpaqueToken, Provider} from './core'; +import {provide, OpaqueToken, Provider} from 'angular2/angular2'; import {CONST_EXPR} from './src/core/facade/lang'; import {ApplicationRef} from './src/core/application_ref'; import {BaseException} from 'angular2/src/core/facade/exceptions'; diff --git a/modules/angular2/src/router/hash_location_strategy.ts b/modules/angular2/src/router/hash_location_strategy.ts index 7c14beef0d..cf78094e74 100644 --- a/modules/angular2/src/router/hash_location_strategy.ts +++ b/modules/angular2/src/router/hash_location_strategy.ts @@ -1,5 +1,5 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {Injectable} from 'angular2/src/core/di'; +import {Injectable} from 'angular2/angular2'; import {LocationStrategy} from './location_strategy'; import {EventListener, History, Location} from 'angular2/src/core/facade/browser'; diff --git a/modules/angular2/src/router/location.ts b/modules/angular2/src/router/location.ts index c640130183..df0041539d 100644 --- a/modules/angular2/src/router/location.ts +++ b/modules/angular2/src/router/location.ts @@ -3,7 +3,7 @@ import {StringWrapper, isPresent, CONST_EXPR} from 'angular2/src/core/facade/lan import {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async'; import {isBlank} from 'angular2/src/core/facade/lang'; import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; -import {OpaqueToken, Injectable, Optional, Inject} from 'angular2/src/core/di'; +import {OpaqueToken, Injectable, Optional, Inject} from 'angular2/angular2'; /** * The `APP_BASE_HREF` token represents the base href to be used with the diff --git a/modules/angular2/src/router/path_location_strategy.ts b/modules/angular2/src/router/path_location_strategy.ts index a5f8e8b600..e3495ffb5c 100644 --- a/modules/angular2/src/router/path_location_strategy.ts +++ b/modules/angular2/src/router/path_location_strategy.ts @@ -1,5 +1,5 @@ import {DOM} from 'angular2/src/core/dom/dom_adapter'; -import {Injectable} from 'angular2/src/core/di'; +import {Injectable} from 'angular2/angular2'; import {EventListener, History, Location} from 'angular2/src/core/facade/browser'; import {LocationStrategy} from './location_strategy'; diff --git a/modules/angular2/src/router/route_data.ts b/modules/angular2/src/router/route_data.ts index 12999206c5..b6469dc46c 100644 --- a/modules/angular2/src/router/route_data.ts +++ b/modules/angular2/src/router/route_data.ts @@ -1,4 +1,4 @@ -import {OpaqueToken} from 'angular2/src/core/di'; +import {OpaqueToken} from 'angular2/angular2'; import {CONST_EXPR} from 'angular2/src/core/facade/lang'; export const ROUTE_DATA: OpaqueToken = CONST_EXPR(new OpaqueToken('routeData')); diff --git a/modules/angular2/src/router/route_registry.ts b/modules/angular2/src/router/route_registry.ts index 8811f3a563..116790d020 100644 --- a/modules/angular2/src/router/route_registry.ts +++ b/modules/angular2/src/router/route_registry.ts @@ -24,7 +24,7 @@ import { RouteDefinition } from './route_config_impl'; import {reflector} from 'angular2/src/core/reflection/reflection'; -import {Injectable} from 'angular2/src/core/di'; +import {Injectable} from 'angular2/angular2'; import {normalizeRouteConfig, assertComponentExists} from './route_config_nomalizer'; import {parser, Url, pathSegmentsToUrl} from './url_parser'; diff --git a/modules/angular2/src/router/router_outlet.ts b/modules/angular2/src/router/router_outlet.ts index 73ce342f68..cc3c6768b0 100644 --- a/modules/angular2/src/router/router_outlet.ts +++ b/modules/angular2/src/router/router_outlet.ts @@ -5,7 +5,7 @@ import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptio import {Directive, Attribute} from 'angular2/src/core/metadata'; import {DynamicComponentLoader, ComponentRef, ElementRef} from 'angular2/src/core/linker'; -import {Injector, provide, Dependency} from 'angular2/src/core/di'; +import {Injector, provide, Dependency} from 'angular2/angular2'; import * as routerMod from './router'; import {ComponentInstruction, RouteParams} from './instruction';