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:
parent
ffc63fc6d6
commit
78a8ba2307
|
@ -22,6 +22,7 @@ export {CanActivate} from './src/router/lifecycle_annotations';
|
||||||
export {Instruction, ComponentInstruction} from './src/router/instruction';
|
export {Instruction, ComponentInstruction} from './src/router/instruction';
|
||||||
export {Url} from './src/router/url_parser';
|
export {Url} from './src/router/url_parser';
|
||||||
export {OpaqueToken, Type} from 'angular2/angular2';
|
export {OpaqueToken, Type} from 'angular2/angular2';
|
||||||
|
export {ROUTE_DATA} from './src/router/route_data';
|
||||||
|
|
||||||
import {LocationStrategy} from './src/router/location_strategy';
|
import {LocationStrategy} from './src/router/location_strategy';
|
||||||
import {HTML5LocationStrategy} from './src/router/html5_location_strategy';
|
import {HTML5LocationStrategy} from './src/router/html5_location_strategy';
|
||||||
|
|
|
@ -2,13 +2,6 @@ import {RouteConfig as RouteConfigAnnotation, RouteDefinition} from './route_con
|
||||||
import {makeDecorator} from 'angular2/src/util/decorators';
|
import {makeDecorator} from 'angular2/src/util/decorators';
|
||||||
import {List} from 'angular2/src/facade/collection';
|
import {List} from 'angular2/src/facade/collection';
|
||||||
|
|
||||||
export {
|
export {Route, Redirect, AuxRoute, AsyncRoute, RouteDefinition} from './route_config_impl';
|
||||||
Route,
|
|
||||||
Redirect,
|
|
||||||
AuxRoute,
|
|
||||||
AsyncRoute,
|
|
||||||
RouteDefinition,
|
|
||||||
ROUTE_DATA
|
|
||||||
} from './route_config_impl';
|
|
||||||
export var RouteConfig: (configs: List<RouteDefinition>) => ClassDecorator =
|
export var RouteConfig: (configs: List<RouteDefinition>) => ClassDecorator =
|
||||||
makeDecorator(RouteConfigAnnotation);
|
makeDecorator(RouteConfigAnnotation);
|
||||||
|
|
|
@ -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 {List} from 'angular2/src/facade/collection';
|
||||||
import {RouteDefinition} from './route_definition';
|
import {RouteDefinition} from './route_definition';
|
||||||
export {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.
|
* You use the RouteConfig annotation to add routes to a component.
|
||||||
|
|
|
@ -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'));
|
|
@ -8,7 +8,7 @@ import {Injector, bind, Dependency, UNDEFINED} from 'angular2/di';
|
||||||
|
|
||||||
import * as routerMod from './router';
|
import * as routerMod from './router';
|
||||||
import {Instruction, ComponentInstruction, RouteParams} from './instruction';
|
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 * as hookMod from './lifecycle_annotations';
|
||||||
import {hasLifecycleHook} from './route_lifecycle_reflector';
|
import {hasLifecycleHook} from './route_lifecycle_reflector';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue