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.
This commit is contained in:
Pawel Kozlowski 2015-10-11 13:17:06 +02:00
parent 6abed8d996
commit 8667b760f4
7 changed files with 7 additions and 7 deletions

View File

@ -28,7 +28,7 @@ import {RouterOutlet} from './src/router/router_outlet';
import {RouterLink} from './src/router/router_link'; import {RouterLink} from './src/router/router_link';
import {RouteRegistry} from './src/router/route_registry'; import {RouteRegistry} from './src/router/route_registry';
import {Location} from './src/router/location'; 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 {CONST_EXPR} from './src/core/facade/lang';
import {ApplicationRef} from './src/core/application_ref'; import {ApplicationRef} from './src/core/application_ref';
import {BaseException} from 'angular2/src/core/facade/exceptions'; import {BaseException} from 'angular2/src/core/facade/exceptions';

View File

@ -1,5 +1,5 @@
import {DOM} from 'angular2/src/core/dom/dom_adapter'; 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 {LocationStrategy} from './location_strategy';
import {EventListener, History, Location} from 'angular2/src/core/facade/browser'; import {EventListener, History, Location} from 'angular2/src/core/facade/browser';

View File

@ -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 {EventEmitter, ObservableWrapper} from 'angular2/src/core/facade/async';
import {isBlank} from 'angular2/src/core/facade/lang'; import {isBlank} from 'angular2/src/core/facade/lang';
import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptions'; 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 * The `APP_BASE_HREF` token represents the base href to be used with the

View File

@ -1,5 +1,5 @@
import {DOM} from 'angular2/src/core/dom/dom_adapter'; 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 {EventListener, History, Location} from 'angular2/src/core/facade/browser';
import {LocationStrategy} from './location_strategy'; import {LocationStrategy} from './location_strategy';

View File

@ -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'; import {CONST_EXPR} from 'angular2/src/core/facade/lang';
export const ROUTE_DATA: OpaqueToken = CONST_EXPR(new OpaqueToken('routeData')); export const ROUTE_DATA: OpaqueToken = CONST_EXPR(new OpaqueToken('routeData'));

View File

@ -24,7 +24,7 @@ import {
RouteDefinition RouteDefinition
} from './route_config_impl'; } from './route_config_impl';
import {reflector} from 'angular2/src/core/reflection/reflection'; 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 {normalizeRouteConfig, assertComponentExists} from './route_config_nomalizer';
import {parser, Url, pathSegmentsToUrl} from './url_parser'; import {parser, Url, pathSegmentsToUrl} from './url_parser';

View File

@ -5,7 +5,7 @@ import {BaseException, WrappedException} from 'angular2/src/core/facade/exceptio
import {Directive, Attribute} from 'angular2/src/core/metadata'; import {Directive, Attribute} from 'angular2/src/core/metadata';
import {DynamicComponentLoader, ComponentRef, ElementRef} from 'angular2/src/core/linker'; 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 * as routerMod from './router';
import {ComponentInstruction, RouteParams} from './instruction'; import {ComponentInstruction, RouteParams} from './instruction';