UNPKG

36.8 kBSource Map (JSON)View Raw
1{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../modules/@angular/router-deprecated/src/router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uBAAuB,iBAAiB,CAAC,CAAA;AACzC,qBAAiC,eAAe,CAAC,CAAA;AAEjD,sBAA8D,qBAAqB,CAAC,CAAA;AACpF,2BAAoC,0BAA0B,CAAC,CAAA;AAC/D,2BAA4B,0BAA0B,CAAC,CAAA;AACvD,qBAAuC,oBAAoB,CAAC,CAAA;AAG5D,4BAAoE,eAAe,CAAC,CAAA;AACpF,0CAAiC,uCAAuC,CAAC,CAAA;AAEzE,+BAAsD,kBAAkB,CAAC,CAAA;AAEzE,IAAI,cAAc,GAAG,sBAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,IAAI,eAAe,GAAG,sBAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AAEH;IAiBE,gBACW,QAAuB,EAAS,MAAc,EAAS,aAAkB,EACzE,IAAa;QADb,aAAQ,GAAR,QAAQ,CAAe;QAAS,WAAM,GAAN,MAAM,CAAQ;QAAS,kBAAa,GAAb,aAAa,CAAK;QACzE,SAAI,GAAJ,IAAI,CAAS;QAlBxB,eAAU,GAAY,KAAK,CAAC;QAE5B;;WAEG;QACI,uBAAkB,GAAgB,IAAI,CAAC;QAEtC,uBAAkB,GAAiB,cAAc,CAAC;QAClD,YAAO,GAAiB,IAAI,CAAC;QAE7B,gBAAW,GAAG,IAAI,gBAAG,EAAkB,CAAC;QAGxC,aAAQ,GAAsB,IAAI,oBAAY,EAAE,CAAC;IAK9B,CAAC;IAE5B;;;OAGG;IACH,4BAAW,GAAX,UAAY,aAAkB;QAC5B,MAAM,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAClE,CAAC;IAGD;;;OAGG;IACH,0BAAS,G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AE,CAAC,CAAC,gBAAS,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,GAAG,cAAc,CACjB,eAAe,CAAC,KAAK,EAAE,gBAAS,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAU,UAAC,MAAe;QACxC,EAAE,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,KAAK,CAAC;QACf,CAAC;QACD,EAAE,CAAC,CAAC,eAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC;QACd,CAAC;QACD,IAAI,IAAI,GAAG,8CAAkB,CAAC,eAAe,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACvE,EAAE,CAAC,CAAC,gBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CACP,eAAe,CAAC,SAAS,EAAE,gBAAS,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QAChG,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {Location} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\n\nimport {EventEmitter, ObservableWrapper, PromiseWrapper} from '../src/facade/async';\nimport {Map, StringMapWrapper} from '../src/facade/collection';\nimport {BaseException} from '../src/facade/exceptions';\nimport {Type, isBlank, isPresent} from '../src/facade/lang';\n\nimport {RouterOutlet} from './directives/router_outlet';\nimport {ComponentInstruction, DefaultInstruction, Instruction} from './instruction';\nimport {getCanActivateHook} from './lifecycle/route_lifecycle_reflector';\nimport {RouteDefinition} from './route_config/route_config_impl';\nimport {ROUTER_PRIMARY_COMPONENT, RouteRegistry} from './route_registry';\n\nlet _resolveToTrue = PromiseWrapper.resolve(true);\nlet _resolveToFalse = PromiseWrapper.resolve(false);\n\n/**\n * The `Router` is responsible for mapping URLs to components.\n *\n * You can see the state of the router by inspecting the read-only field `router.navigating`.\n * This may be useful for showing a spinner, for instance.\n *\n * ## Concepts\n *\n * Routers and component instances have a 1:1 correspondence.\n *\n * The router holds reference to a number of {@link RouterOutlet}.\n * An outlet is a placeholder that the router dynamically fills in depending on the current URL.\n *\n * When the router navigates from a URL, it must first recognize it and serialize it into an\n * `Instruction`.\n * The router uses the `RouteRegistry` to get an `Instruction`.\n */\n@Injectable()\nexport class Router {\n navigating: boolean = false;\n lastNavigationAttempt: string;\n /**\n * The current `Instruction` for the router\n */\n public currentInstruction: Instruction = null;\n\n private _currentNavigation: Promise<any> = _resolveToTrue;\n private _outlet: RouterOutlet = null;\n\n private _auxRouters = new Map<string, Router>();\n private _childRouter: Router;\n\n private _subject: EventEmitter<any> = new EventEmitter();\n\n\n constructor(\n public registry: RouteRegistry, public parent: Router, public hostComponent: any,\n public root?: Router) {}\n\n /**\n * Constructs a child router. You probably don't need to use this unless you're writing a reusable\n * component.\n */\n childRouter(hostComponent: any): Router {\n return this._childRouter = new ChildRouter(this, hostComponent);\n }\n\n\n /**\n * Constructs a child router. You probably don't need to use this unless you're writing a reusable\n * component.\n */\n auxRouter(hostComponent: any): Router { return new ChildRouter(this, hostComponent); }\n\n /**\n * Register an outlet to be notified of primary route changes.\n *\n * You probably don't need to use this unless you're writing a reusable component.\n */\n registerPrimaryOutlet(outlet: RouterOutlet): Promise<any> {\n if (isPresent(outlet.name)) {\n throw new BaseException(`registerPrimaryOutlet expects to be called with an unnamed outlet.`);\n }\n\n if (isPresent(this._outlet)) {\n throw new BaseException(`Primary outlet is already registered.`);\n }\n\n this._outlet = outlet;\n if (isPresent(this.currentInstruction)) {\n return this.commit(this.currentInstruction, false);\n }\n return _resolveToTrue;\n }\n\n /**\n * Unregister an outlet (because it was destroyed, etc).\n *\n * You probably don't need to use this unless you're writing a custom outlet implementation.\n */\n unregisterPrimaryOutlet(outlet: RouterOutlet): void {\n if (isPresent(outlet.name)) {\n throw new BaseException(`registerPrimaryOutlet expects to be called with an unnamed outlet.`);\n }\n this._outlet = null;\n }\n\n\n /**\n * Register an outlet to notified of auxiliary route changes.\n *\n * You probably don't need to use this unless you're writing a reusable component.\n */\n registerAuxOutlet(outlet: RouterOutlet): Promise<any> {\n var outletName = outlet.name;\n if (isBlank(outletName)) {\n throw new BaseException(`registerAuxOutlet expects to be called with an outlet with a name.`);\n }\n\n var router = this.auxRouter(this.hostComponent);\n\n this._auxRouters.set(outletName, router);\n router._outlet = outlet;\n\n var auxInstruction: any /** TODO #9100 */;\n if (isPresent(this.currentInstruction) &&\n isPresent(auxInstruction = this.currentInstruction.auxInstruction[outletName])) {\n return router.commit(auxInstruction);\n }\n return _resolveToTrue;\n }\n\n\n /**\n * Given an instruction, returns `true` if the instruction is currently active,\n * otherwise `false`.\n */\n isRouteActive(instruction: Instruction): boolean {\n var router: Router = this;\n var currentInstruction = this.currentInstruction;\n\n if (isBlank(currentInstruction)) {\n return false;\n }\n\n // `instruction` corresponds to the root router\n while (isPresent(router.parent) && isPresent(instruction.child)) {\n router = router.parent;\n instruction = instruction.child;\n }\n\n let reason = true;\n\n // check the instructions in depth\n do {\n if (isBlank(instruction.component) || isBlank(currentInstruction.component) ||\n currentInstruction.component.routeName != instruction.component.routeName) {\n return false;\n }\n if (isPresent(instruction.component.params)) {\n StringMapWrapper.forEach(\n instruction.component.params,\n (value: any /** TODO #9100 */, key: any /** TODO #9100 */) => {\n if (currentInstruction.component.params[key] !== value) {\n reason = false;\n }\n });\n }\n currentInstruction = currentInstruction.child;\n instruction = instruction.child;\n } while (isPresent(currentInstruction) && isPresent(instruction) &&\n !(instruction instanceof DefaultInstruction) && reason);\n\n // ignore DefaultInstruction\n return reason && (isBlank(instruction) || instruction instanceof DefaultInstruction);\n }\n\n\n /**\n * Dynamically update the routing configuration and trigger a navigation.\n *\n * ### Usage\n *\n * ```\n * router.config([\n * { 'path': '/', 'component': IndexComp },\n * { 'path': '/user/:id', 'component': UserComp },\n * ]);\n * ```\n */\n config(definitions: RouteDefinition[]): Promise<any> {\n definitions.forEach(\n (routeDefinition) => { this.registry.config(this.hostComponent, routeDefinition); });\n return this.renavigate();\n }\n\n\n /**\n * Navigate based on the provided Route Link DSL. It's preferred to navigate with this method\n * over `navigateByUrl`.\n *\n * ### Usage\n *\n * This method takes an array representing the Route Link DSL:\n * ```\n * ['./MyCmp', {param: 3}]\n * ```\n * See the {@link RouterLink} directive for more.\n */\n navigate(linkParams: any[]): Promise<any> {\n var instruction = this.generate(linkParams);\n return this.navigateByInstruction(instruction, false);\n }\n\n\n /**\n * Navigate to a URL. Returns a promise that resolves when navigation is complete.\n * It's preferred to navigate with `navigate` instead of this method, since URLs are more brittle.\n *\n * If the given URL begins with a `/`, router will navigate absolutely.\n * If the given URL does not begin with `/`, the router will navigate relative to this component.\n */\n navigateByUrl(url: string, _skipLocationChange: boolean = false): Promise<any> {\n return this._currentNavigation = this._currentNavigation.then((_) => {\n this.lastNavigationAttempt = url;\n this._startNavigating();\n return this._afterPromiseFinishNavigating(this.recognize(url).then((instruction) => {\n if (isBlank(instruction)) {\n return false;\n }\n return this._navigate(instruction, _skipLocationChange);\n }));\n });\n }\n\n\n /**\n * Navigate via the provided instruction. Returns a promise that resolves when navigation is\n * complete.\n */\n navigateByInstruction(instruction: Instruction, _skipLocationChange: boolean = false):\n Promise<any> {\n if (isBlank(instruction)) {\n return _resolveToFalse;\n }\n return this._currentNavigation = this._currentNavigation.then((_) => {\n this._startNavigating();\n return this._afterPromiseFinishNavigating(this._navigate(instruction, _skipLocationChange));\n });\n }\n\n /** @internal */\n _settleInstruction(instruction: Instruction): Promise<any> {\n return instruction.resolveComponent().then((_) => {\n var unsettledInstructions: Array<Promise<any>> = [];\n\n if (isPresent(instruction.component)) {\n instruction.component.reuse = false;\n }\n\n if (isPresent(instruction.child)) {\n unsettledInstructions.push(this._settleInstruction(instruction.child));\n }\n\n StringMapWrapper.forEach(\n instruction.auxInstruction, (instruction: Instruction, _: any /** TODO #9100 */) => {\n unsettledInstructions.push(this._settleInstruction(instruction));\n });\n return PromiseWrapper.all(unsettledInstructions);\n });\n }\n\n /** @internal */\n _navigate(instruction: Instruction, _skipLocationChange: boolean): Promise<any> {\n return this._settleInstruction(instruction)\n .then((_) => this._routerCanReuse(instruction))\n .then((_) => this._canActivate(instruction))\n .then((result: boolean) => {\n if (!result) {\n return false;\n }\n return this._routerCanDeactivate(instruction).then((result: boolean) => {\n if (result) {\n return this.commit(instruction, _skipLocationChange).then((_) => {\n this._emitNavigationFinish(instruction.component);\n return true;\n });\n }\n });\n });\n }\n\n private _emitNavigationFinish(instruction: ComponentInstruction): void {\n ObservableWrapper.callEmit(this._subject, {status: 'success', instruction});\n }\n /** @internal */\n _emitNavigationFail(url: string): void {\n ObservableWrapper.callEmit(this._subject, {status: 'fail', url});\n }\n\n private _afterPromiseFinishNavigating(promise: Promise<any>): Promise<any> {\n return PromiseWrapper.catchError(promise.then((_) => this._finishNavigating()), (err) => {\n this._finishNavigating();\n throw err;\n });\n }\n\n /*\n * Recursively set reuse flags\n */\n /** @internal */\n _routerCanReuse(instruction: Instruction): Promise<any> {\n if (isBlank(this._outlet)) {\n return _resolveToFalse;\n }\n if (isBlank(instruction.component)) {\n return _resolveToTrue;\n }\n return this._outlet.routerCanReuse(instruction.component).then((result) => {\n instruction.component.reuse = result;\n if (result && isPresent(this._childRouter) && isPresent(instruction.child)) {\n return this._childRouter._routerCanReuse(instruction.child);\n }\n });\n }\n\n private _canActivate(nextInstruction: Instruction): Promise<boolean> {\n return canActivateOne(nextInstruction, this.currentInstruction);\n }\n\n private _routerCanDeactivate(instruction: Instruction): Promise<boolean> {\n if (isBlank(this._outlet)) {\n return _resolveToTrue;\n }\n var next: Promise<boolean>;\n var childInstruction: Instruction = null;\n var reuse: boolean = false;\n var componentInstruction: ComponentInstruction = null;\n if (isPresent(instruction)) {\n childInstruction = instruction.child;\n componentInstruction = instruction.component;\n reuse = isBlank(instruction.component) || instruction.component.reuse;\n }\n if (reuse) {\n next = _resolveToTrue;\n } else {\n next = this._outlet.routerCanDeactivate(componentInstruction);\n }\n // TODO: aux route lifecycle hooks\n return next.then<boolean>((result): boolean | Promise<boolean> => {\n if (result == false) {\n return false;\n }\n if (isPresent(this._childRouter)) {\n // TODO: ideally, this closure would map to async-await in Dart.\n // For now, casting to any to suppress an error.\n return <any>this._childRouter._routerCanDeactivate(childInstruction);\n }\n return true;\n });\n }\n\n /**\n * Updates this router and all descendant routers according to the given instruction\n */\n commit(instruction: Instruction, _skipLocationChange: boolean = false): Promise<any> {\n this.currentInstruction = instruction;\n\n var next: Promise<any> = _resolveToTrue;\n if (isPresent(this._outlet) && isPresent(instruction.component)) {\n var componentInstruction = instruction.component;\n if (componentInstruction.reuse) {\n next = this._outlet.reuse(componentInstruction);\n } else {\n next =\n this.deactivate(instruction).then((_) => this._outlet.activate(componentInstruction));\n }\n if (isPresent(instruction.child)) {\n next = next.then((_) => {\n if (isPresent(this._childRouter)) {\n return this._childRouter.commit(instruction.child);\n }\n });\n }\n }\n\n var promises: Promise<any>[] = [];\n this._auxRouters.forEach((router, name) => {\n if (isPresent(instruction.auxInstruction[name])) {\n promises.push(router.commit(instruction.auxInstruction[name]));\n }\n });\n\n return next.then((_) => PromiseWrapper.all(promises));\n }\n\n\n /** @internal */\n _startNavigating(): void { this.navigating = true; }\n\n /** @internal */\n _finishNavigating(): void { this.navigating = false; }\n\n\n /**\n * Subscribe to URL updates from the router\n */\n subscribe(onNext: (value: any) => void, onError?: (value: any) => void): Object {\n return ObservableWrapper.subscribe(this._subject, onNext, onError);\n }\n\n\n /**\n * Removes the contents of this router's outlet and all descendant outlets\n */\n deactivate(instruction: Instruction): Promise<any> {\n var childInstruction: Instruction = null;\n var componentInstruction: ComponentInstruction = null;\n if (isPresent(instruction)) {\n childInstruction = instruction.child;\n componentInstruction = instruction.component;\n }\n var next: Promise<any> = _resolveToTrue;\n if (isPresent(this._childRouter)) {\n next = this._childRouter.deactivate(childInstruction);\n }\n if (isPresent(this._outlet)) {\n next = next.then((_) => this._outlet.deactivate(componentInstruction));\n }\n\n // TODO: handle aux routes\n\n return next;\n }\n\n\n /**\n * Given a URL, returns an instruction representing the component graph\n */\n recognize(url: string): Promise<Instruction> {\n var ancestorComponents = this._getAncestorInstructions();\n return this.registry.recognize(url, ancestorComponents);\n }\n\n private _getAncestorInstructions(): Instruction[] {\n var ancestorInstructions: Instruction[] = [this.currentInstruction];\n var ancestorRouter: Router = this;\n while (isPresent(ancestorRouter = ancestorRouter.parent)) {\n ancestorInstructions.unshift(ancestorRouter.currentInstruction);\n }\n return ancestorInstructions;\n }\n\n\n /**\n * Navigates to either the last URL successfully navigated to, or the last URL requested if the\n * router has yet to successfully navigate.\n */\n renavigate(): Promise<any> {\n if (isBlank(this.lastNavigationAttempt)) {\n return this._currentNavigation;\n }\n return this.navigateByUrl(this.lastNavigationAttempt);\n }\n\n\n /**\n * Generate an `Instruction` based on the provided Route Link DSL.\n */\n generate(linkParams: any[]): Instruction {\n var ancestorInstructions = this._getAncestorInstructions();\n return this.registry.generate(linkParams, ancestorInstructions);\n }\n}\n\n@Injectable()\nexport class RootRouter extends Router {\n /** @internal */\n _location: Location;\n /** @internal */\n _locationSub: Object;\n\n constructor(\n registry: RouteRegistry, location: Location,\n @Inject(ROUTER_PRIMARY_COMPONENT) primaryComponent: Type) {\n super(registry, null, primaryComponent);\n this.root = this;\n this._location = location;\n this._locationSub = this._location.subscribe((change) => {\n // we call recognize ourselves\n this.recognize(change['url']).then((instruction) => {\n if (isPresent(instruction)) {\n this.navigateByInstruction(instruction, isPresent(change['pop'])).then((_) => {\n // this is a popstate event; no need to change the URL\n if (isPresent(change['pop']) && change['type'] != 'hashchange') {\n return;\n }\n var emitPath = instruction.toUrlPath();\n var emitQuery = instruction.toUrlQuery();\n if (emitPath.length > 0 && emitPath[0] != '/') {\n emitPath = '/' + emitPath;\n }\n\n // We've opted to use pushstate and popState APIs regardless of whether you\n // an app uses HashLocationStrategy or PathLocationStrategy.\n // However, apps that are migrating might have hash links that operate outside\n // angular to which routing must respond.\n // Therefore we know that all hashchange events occur outside Angular.\n // To support these cases where we respond to hashchanges and redirect as a\n // result, we need to replace the top item on the stack.\n if (change['type'] == 'hashchange') {\n if (instruction.toRootUrl() != this._location.path()) {\n this._location.replaceState(emitPath, emitQuery);\n }\n } else {\n this._location.go(emitPath, emitQuery);\n }\n });\n } else {\n this._emitNavigationFail(change['url']);\n }\n });\n });\n\n this.registry.configFromComponent(primaryComponent);\n this.navigateByUrl(location.path());\n }\n\n commit(instruction: Instruction, _skipLocationChange: boolean = false): Promise<any> {\n var emitPath = instruction.toUrlPath();\n var emitQuery = instruction.toUrlQuery();\n if (emitPath.length > 0 && emitPath[0] != '/') {\n emitPath = '/' + emitPath;\n }\n var promise = super.commit(instruction);\n if (!_skipLocationChange) {\n if (this._location.isCurrentPathEqualTo(emitPath, emitQuery)) {\n promise = promise.then((_) => { this._location.replaceState(emitPath, emitQuery); });\n } else {\n promise = promise.then((_) => { this._location.go(emitPath, emitQuery); });\n }\n }\n return promise;\n }\n\n dispose(): void {\n if (isPresent(this._locationSub)) {\n ObservableWrapper.dispose(this._locationSub);\n this._locationSub = null;\n }\n }\n}\n\nclass ChildRouter extends Router {\n constructor(parent: Router, hostComponent: any /** TODO #9100 */) {\n super(parent.registry, parent, hostComponent, parent.root);\n this.parent = parent;\n }\n\n\n navigateByUrl(url: string, _skipLocationChange: boolean = false): Promise<any> {\n // Delegate navigation to the root router\n return this.parent.navigateByUrl(url, _skipLocationChange);\n }\n\n navigateByInstruction(instruction: Instruction, _skipLocationChange: boolean = false):\n Promise<any> {\n // Delegate navigation to the root router\n return this.parent.navigateByInstruction(instruction, _skipLocationChange);\n }\n}\n\n\nfunction canActivateOne(\n nextInstruction: Instruction, prevInstruction: Instruction): Promise<boolean> {\n var next = _resolveToTrue;\n if (isBlank(nextInstruction.component)) {\n return next;\n }\n if (isPresent(nextInstruction.child)) {\n next = canActivateOne(\n nextInstruction.child, isPresent(prevInstruction) ? prevInstruction.child : null);\n }\n return next.then<boolean>((result: boolean): boolean => {\n if (result == false) {\n return false;\n }\n if (nextInstruction.component.reuse) {\n return true;\n }\n var hook = getCanActivateHook(nextInstruction.component.componentType);\n if (isPresent(hook)) {\n return hook(\n nextInstruction.component, isPresent(prevInstruction) ? prevInstruction.component : null);\n }\n return true;\n });\n}\n"]}
\No newline at end of file