BREAKING CHANGE: This is a rename to make routing concepts easier to understand. Before: ``` @RouteConfig([ { path: '/', component: MyCmp, as: 'Home' } ]) ``` After: ``` @RouteConfig([ { path: '/', component: MyCmp, name: 'Home' } ]) ``` Closes #4622 Closes #4896
29 lines
724 B
TypeScript
29 lines
724 B
TypeScript
import {CONST, Type} from 'angular2/src/core/facade/lang';
|
|
|
|
/**
|
|
* `RouteDefinition` defines a route within a {@link RouteConfig} decorator.
|
|
*
|
|
* Supported keys:
|
|
* - `path` (required)
|
|
* - `component`, `loader`, `redirectTo` (requires exactly one of these)
|
|
* - `name` or `as` (optional) (requires exactly one of these)
|
|
* - `data` (optional)
|
|
*
|
|
* See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}.
|
|
*/
|
|
export interface RouteDefinition {
|
|
path: string;
|
|
component?: Type | ComponentDefinition;
|
|
loader?: Function;
|
|
redirectTo?: string;
|
|
as?: string;
|
|
name?: string;
|
|
data?: any;
|
|
}
|
|
|
|
export interface ComponentDefinition {
|
|
type: string;
|
|
loader?: Function;
|
|
component?: Type;
|
|
}
|