Files
angular-docs-cn/modules/@angular/router-deprecated/src/route_definition.ts
T

40 lines
1.0 KiB
TypeScript
Raw Normal View History

import {Type} from '../src/facade/lang';
2016-02-09 11:12:41 -08:00
import {RegexSerializer} from './rules/route_paths/regex_route_path';
/**
* `RouteDefinition` defines a route within a {@link RouteConfig} decorator.
*
* Supported keys:
* - `path` or `aux` (requires exactly one of these)
* - `component`, `loader`, `redirectTo` (requires exactly one of these)
* - `name` (optional)
* - `data` (optional)
*
* See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}.
*/
export interface RouteDefinition {
path?: string;
aux?: string;
2016-02-09 11:12:41 -08:00
regex?: string;
regex_group_names?: string[];
2016-02-09 11:12:41 -08:00
serializer?: RegexSerializer;
component?: Type | ComponentDefinition;
2016-02-19 11:49:31 -08:00
loader?: () => Promise<Type>;
redirectTo?: any[];
name?: string;
data?: any;
useAsDefault?: boolean;
}
/**
* Represents either a component type (`type` is `component`) or a loader function
* (`type` is `loader`).
*
* See also {@link RouteDefinition}.
*/
export interface ComponentDefinition {
type: string;
2016-02-19 11:49:31 -08:00
loader?: () => Promise<Type>;
component?: Type;
}