refactor(router): move ROUTE_DATA token into own file

This change is to accomodate the router in Angular 1.x
This commit is contained in:
Brian Ford 2015-08-18 12:29:26 -07:00
parent ffc63fc6d6
commit 78a8ba2307
5 changed files with 8 additions and 13 deletions

View File

@ -22,6 +22,7 @@ export {CanActivate} from './src/router/lifecycle_annotations';
export {Instruction, ComponentInstruction} from './src/router/instruction';
export {Url} from './src/router/url_parser';
export {OpaqueToken, Type} from 'angular2/angular2';
export {ROUTE_DATA} from './src/router/route_data';
import {LocationStrategy} from './src/router/location_strategy';
import {HTML5LocationStrategy} from './src/router/html5_location_strategy';

View File

@ -2,13 +2,6 @@ import {RouteConfig as RouteConfigAnnotation, RouteDefinition} from './route_con
import {makeDecorator} from 'angular2/src/util/decorators';
import {List} from 'angular2/src/facade/collection';
export {
Route,
Redirect,
AuxRoute,
AsyncRoute,
RouteDefinition,
ROUTE_DATA
} from './route_config_impl';
export {Route, Redirect, AuxRoute, AsyncRoute, RouteDefinition} from './route_config_impl';
export var RouteConfig: (configs: List<RouteDefinition>) => ClassDecorator =
makeDecorator(RouteConfigAnnotation);

View File

@ -1,10 +1,7 @@
import {CONST, CONST_EXPR, Type} from 'angular2/src/facade/lang';
import {CONST, Type} from 'angular2/src/facade/lang';
import {List} from 'angular2/src/facade/collection';
import {RouteDefinition} from './route_definition';
export {RouteDefinition} from './route_definition';
import {OpaqueToken} from 'angular2/di';
export const ROUTE_DATA: OpaqueToken = CONST_EXPR(new OpaqueToken('routeData'));
/**
* You use the RouteConfig annotation to add routes to a component.

View File

@ -0,0 +1,4 @@
import {OpaqueToken} from 'angular2/di';
import {CONST_EXPR} from 'angular2/src/facade/lang';
export const ROUTE_DATA: OpaqueToken = CONST_EXPR(new OpaqueToken('routeData'));

View File

@ -8,7 +8,7 @@ import {Injector, bind, Dependency, UNDEFINED} from 'angular2/di';
import * as routerMod from './router';
import {Instruction, ComponentInstruction, RouteParams} from './instruction';
import {ROUTE_DATA} from './route_config_impl';
import {ROUTE_DATA} from './route_data';
import * as hookMod from './lifecycle_annotations';
import {hasLifecycleHook} from './route_lifecycle_reflector';