UNPKG

8.86 kBSource Map (JSON)View Raw
1{"version":3,"file":"route_config_impl.js","sourceRoot":"","sources":["../../../../../modules/@angular/router-deprecated/src/route_config/route_config_impl.ts"],"names":[],"mappings":";;;;;;AAMA,IAAI,0BAA0B,GAAiB,IAAI,CAAC;AAEpD;;;;;GAKG;AACH;IACE,qBAAmB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IACnD,kBAAC;AAAD,CAAC,AAFD,IAEC;AAFY,mBAAW,cAEvB,CAAA;AAED,oBAAoB;AACpB;IASE,uBAAY,EACuB;YADtB,cAAI,EAAE,8BAAY,EAAE,cAAI,EAAE,gBAAK,EAAE,wCAAiB,EAAE,0BAAU,EAC9D,cAAI;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACH,oBAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBqB,qBAAa,gBAmBlC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAA2B,yBAAa;IAItC,eAAY,EAC4B;YAD3B,cAAI,EAAE,8BAAY,EAAE,cAAI,EAAE,gBAAK,EAAE,wCAAiB,EAAE,0BAAU,EAAE,cAAI,EACpE,wBAAS;QACpB,kBAAM;YACJ,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,iBAAiB,EAAE,iBAAiB;YACpC,UAAU,EAAE,UAAU;YACtB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAZL,QAAG,G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;;;;;;;;;;;;;;;GAqBG;AACH;IAA8B,4BAAa;IAGzC,kBAAY,EAC6B;YAD5B,cAAI,EAAE,8BAAY,EAAE,cAAI,EAAE,gBAAK,EAAE,wCAAiB,EAAE,0BAAU,EAAE,cAAI,EACpE,0BAAU;QACrB,kBAAM;YACJ,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,iBAAiB,EAAE,iBAAiB;YACpC,UAAU,EAAE,UAAU;YACtB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IACH,eAAC;AAAD,CAAC,AAhBD,CAA8B,aAAa,GAgB1C;AAhBY,gBAAQ,WAgBpB,CAAA","sourcesContent":["import {Type} from '../facade/lang';\nimport {RouteDefinition} from '../route_definition';\nimport {RegexSerializer} from '../rules/route_paths/regex_route_path';\n\nexport {RouteDefinition} from '../route_definition';\n\nvar __make_dart_analyzer_happy: Promise<any> = null;\n\n/**\n * The `RouteConfig` decorator defines routes for a given component.\n *\n * It takes an array of {@link RouteDefinition}s.\n * @ts2dart_const\n */\nexport class RouteConfig {\n constructor(public configs: RouteDefinition[]) {}\n}\n\n/* @ts2dart_const */\nexport abstract class AbstractRoute implements RouteDefinition {\n name: string;\n useAsDefault: boolean;\n path: string;\n regex: string;\n regex_group_names: string[];\n serializer: RegexSerializer;\n data: {[key: string]: any};\n\n constructor({name, useAsDefault, path, regex, regex_group_names, serializer,\n data}: RouteDefinition) {\n this.name = name;\n this.useAsDefault = useAsDefault;\n this.path = path;\n this.regex = regex;\n this.regex_group_names = regex_group_names;\n this.serializer = serializer;\n this.data = data;\n }\n}\n\n/**\n * `Route` is a type of {@link RouteDefinition} used to route a path to a component.\n *\n * It has the following properties:\n * - `path` is a string that uses the route matcher DSL.\n * - `component` a component type.\n * - `name` is an optional `CamelCase` string representing the name of the route.\n * - `data` is an optional property of any type representing arbitrary route metadata for the given\n * route. It is injectable via {@link RouteData}.\n * - `useAsDefault` is a boolean value. If `true`, the child route will be navigated to if no child\n * route is specified during the navigation.\n *\n * ### Example\n * ```\n * import {RouteConfig, Route} from '@angular/router-deprecated';\n *\n * @RouteConfig([\n * new Route({path: '/home', component: HomeCmp, name: 'HomeCmp' })\n * ])\n * class MyApp {}\n * ```\n * @ts2dart_const\n */\nexport class Route extends AbstractRoute {\n component: any;\n aux: string = null;\n\n constructor({name, useAsDefault, path, regex, regex_group_names, serializer, data,\n component}: RouteDefinition) {\n super({\n name: name,\n useAsDefault: useAsDefault,\n path: path,\n regex: regex,\n regex_group_names: regex_group_names,\n serializer: serializer,\n data: data\n });\n this.component = component;\n }\n}\n\n/**\n * `AuxRoute` is a type of {@link RouteDefinition} used to define an auxiliary route.\n *\n * It takes an object with the following properties:\n * - `path` is a string that uses the route matcher DSL.\n * - `component` a component type.\n * - `name` is an optional `CamelCase` string representing the name of the route.\n * - `data` is an optional property of any type representing arbitrary route metadata for the given\n * route. It is injectable via {@link RouteData}.\n *\n * ### Example\n * ```\n * import {RouteConfig, AuxRoute} from '@angular/router-deprecated';\n *\n * @RouteConfig([\n * new AuxRoute({path: '/home', component: HomeCmp})\n * ])\n * class MyApp {}\n * ```\n * @ts2dart_const\n */\nexport class AuxRoute extends AbstractRoute {\n component: any;\n\n constructor({name, useAsDefault, path, regex, regex_group_names, serializer, data,\n component}: RouteDefinition) {\n super({\n name: name,\n useAsDefault: useAsDefault,\n path: path,\n regex: regex,\n regex_group_names: regex_group_names,\n serializer: serializer,\n data: data\n });\n this.component = component;\n }\n}\n\n/**\n * `AsyncRoute` is a type of {@link RouteDefinition} used to route a path to an asynchronously\n * loaded component.\n *\n * It has the following properties:\n * - `path` is a string that uses the route matcher DSL.\n * - `loader` is a function that returns a promise that resolves to a component.\n * - `name` is an optional `CamelCase` string representing the name of the route.\n * - `data` is an optional property of any type representing arbitrary route metadata for the given\n * route. It is injectable via {@link RouteData}.\n * - `useAsDefault` is a boolean value. If `true`, the child route will be navigated to if no child\n * route is specified during the navigation.\n *\n * ### Example\n * ```\n * import {RouteConfig, AsyncRoute} from '@angular/router-deprecated';\n *\n * @RouteConfig([\n * new AsyncRoute({path: '/home', loader: () => Promise.resolve(MyLoadedCmp), name:\n * 'MyLoadedCmp'})\n * ])\n * class MyApp {}\n * ```\n * @ts2dart_const\n */\nexport class AsyncRoute extends AbstractRoute {\n loader: () => Promise<Type>;\n aux: string = null;\n\n constructor({name, useAsDefault, path, regex, regex_group_names, serializer, data,\n loader}: RouteDefinition) {\n super({\n name: name,\n useAsDefault: useAsDefault,\n path: path,\n regex: regex,\n regex_group_names: regex_group_names,\n serializer: serializer,\n data: data\n });\n this.loader = loader;\n }\n}\n\n/**\n * `Redirect` is a type of {@link RouteDefinition} used to route a path to a canonical route.\n *\n * It has the following properties:\n * - `path` is a string that uses the route matcher DSL.\n * - `redirectTo` is an array representing the link DSL.\n *\n * Note that redirects **do not** affect how links are generated. For that, see the `useAsDefault`\n * option.\n *\n * ### Example\n * ```\n * import {RouteConfig, Route, Redirect} from '@angular/router-deprecated';\n *\n * @RouteConfig([\n * new Redirect({path: '/', redirectTo: ['/Home'] }),\n * new Route({path: '/home', component: HomeCmp, name: 'Home'})\n * ])\n * class MyApp {}\n * ```\n * @ts2dart_const\n */\nexport class Redirect extends AbstractRoute {\n redirectTo: any[];\n\n constructor({name, useAsDefault, path, regex, regex_group_names, serializer, data,\n redirectTo}: RouteDefinition) {\n super({\n name: name,\n useAsDefault: useAsDefault,\n path: path,\n regex: regex,\n regex_group_names: regex_group_names,\n serializer: serializer,\n data: data\n });\n this.redirectTo = redirectTo;\n }\n}\n"]}
\No newline at end of file