Socket
Socket
Sign inDemoInstall

@angular/router

Package Overview
Dependencies
Maintainers
1
Versions
857
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/router - npm Package Compare versions

Comparing version 3.3.0-rc.0 to 3.3.0

src/version.d.ts

2

bundles/router-testing.umd.js
/**
* @license Angular v3.3.0-rc.0
* @license Angular v3.3.0
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license Angular v3.3.0-rc.0
* @license Angular v3.3.0
* (c) 2010-2016 Google, Inc. https://angular.io/

@@ -39,4 +39,10 @@ * License: MIT

};
/**
* @internal
*/
function initialRouterNavigation(ngUpgrade, ref, preloader, opts) {
return function () {
if (!ngUpgrade.$injector) {
throw new Error("\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n ");
}
var router = ngUpgrade.injector.get(_angular_router.Router);

@@ -50,19 +56,29 @@ var ref = ngUpgrade.injector.get(_angular_core.ApplicationRef);

else {
setTimeout(function () { router.initialNavigation(); }, 0);
router.initialNavigation();
}
// History.pushState does not fire onPopState, so the angular2 location
// doesn't detect it. The workaround is to attach a location change listener
// that will call navigate directly.
ngUpgrade.$injector.get('$rootScope')
.$on('$locationChangeStart', function (_, next, __) {
var url = document.createElement('a');
url.href = next;
router.navigateByUrl(url.pathname);
});
setUpLocationSync(ngUpgrade);
};
}
/**
* @whatItDoes Sets up a location synchronization.
*
* History.pushState does not fire onPopState, so the angular2 location
* doesn't detect it. The workaround is to attach a location change listener
*
* @experimental
*/
function setUpLocationSync(ngUpgrade) {
var router = ngUpgrade.injector.get(_angular_router.Router);
var url = document.createElement('a');
ngUpgrade.$injector.get('$rootScope')
.$on('$locationChangeStart', function (_, next, __) {
url.href = next;
router.navigateByUrl(url.pathname);
});
}
exports.RouterUpgradeInitializer = RouterUpgradeInitializer;
exports.initialRouterNavigation = initialRouterNavigation;
exports.setUpLocationSync = setUpLocationSync;
}));
/**
* @license Angular v3.3.0-rc.0
* @license Angular v3.3.0
* (c) 2010-2016 Google, Inc. https://angular.io/
* License: MIT
*/
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/router"),require("@angular/upgrade/static")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/router","@angular/upgrade/static"],factory):factory((global.ng=global.ng||{},global.ng.router=global.ng.router||{},global.ng.router.upgrade=global.ng.router.upgrade||{}),global.ng.core,global.ng.router,global.ng.upgrade.static)}(this,function(exports,_angular_core,_angular_router,_angular_upgrade_static){"use strict";function initialRouterNavigation(ngUpgrade,ref,preloader,opts){return function(){var router=ngUpgrade.injector.get(_angular_router.Router),ref=ngUpgrade.injector.get(_angular_core.ApplicationRef);router.resetRootComponentType(ref.componentTypes[0]),preloader.setUpPreloading(),opts.initialNavigation===!1?router.setUpLocationChangeListener():setTimeout(function(){router.initialNavigation()},0),ngUpgrade.$injector.get("$rootScope").$on("$locationChangeStart",function(_,next,__){var url=document.createElement("a");url.href=next,router.navigateByUrl(url.pathname)})}}var RouterUpgradeInitializer={provide:_angular_router.ROUTER_INITIALIZER,useFactory:initialRouterNavigation,deps:[_angular_upgrade_static.UpgradeModule,_angular_core.ApplicationRef,_angular_router.RouterPreloader,_angular_router.ROUTER_CONFIGURATION]};exports.RouterUpgradeInitializer=RouterUpgradeInitializer,exports.initialRouterNavigation=initialRouterNavigation});
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/router"),require("@angular/upgrade/static")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/router","@angular/upgrade/static"],factory):factory((global.ng=global.ng||{},global.ng.router=global.ng.router||{},global.ng.router.upgrade=global.ng.router.upgrade||{}),global.ng.core,global.ng.router,global.ng.upgrade.static)}(this,function(exports,_angular_core,_angular_router,_angular_upgrade_static){"use strict";function initialRouterNavigation(ngUpgrade,ref,preloader,opts){return function(){if(!ngUpgrade.$injector)throw new Error("\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n ");var router=ngUpgrade.injector.get(_angular_router.Router),ref=ngUpgrade.injector.get(_angular_core.ApplicationRef);router.resetRootComponentType(ref.componentTypes[0]),preloader.setUpPreloading(),opts.initialNavigation===!1?router.setUpLocationChangeListener():router.initialNavigation(),setUpLocationSync(ngUpgrade)}}function setUpLocationSync(ngUpgrade){var router=ngUpgrade.injector.get(_angular_router.Router),url=document.createElement("a");ngUpgrade.$injector.get("$rootScope").$on("$locationChangeStart",function(_,next,__){url.href=next,router.navigateByUrl(url.pathname)})}var RouterUpgradeInitializer={provide:_angular_router.ROUTER_INITIALIZER,useFactory:initialRouterNavigation,deps:[_angular_upgrade_static.UpgradeModule,_angular_core.ApplicationRef,_angular_router.RouterPreloader,_angular_router.ROUTER_CONFIGURATION]};exports.RouterUpgradeInitializer=RouterUpgradeInitializer,exports.initialRouterNavigation=initialRouterNavigation,exports.setUpLocationSync=setUpLocationSync});

@@ -13,7 +13,2 @@ /**

*/
import { Version } from '@angular/core';
/**
* @stable
*/
export declare const VERSION: Version;
export * from './src/index';

@@ -8,8 +8,8 @@ /**

*/
import { Version } from '@angular/core';
/**
* @stable
* @module
* @description
* Entry point for all public APIs of the router package.
*/
export var /** @type {?} */ VERSION = new Version('3.3.0-rc.0');
export { RouterLink, RouterLinkWithHref, RouterLinkActive, RouterOutlet, RouteReuseStrategy, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RoutesRecognized, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, RouterModule, provideRoutes, RouterOutletMap, NoPreloading, PreloadAllModules, PreloadingStrategy, RouterPreloader, ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot, PRIMARY_OUTLET, UrlHandlingStrategy, DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, __router_private__ } from './src/index';
export { RouterLink, RouterLinkWithHref, RouterLinkActive, RouterOutlet, RouteReuseStrategy, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RoutesRecognized, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, RouterModule, provideRoutes, RouterOutletMap, NoPreloading, PreloadAllModules, PreloadingStrategy, RouterPreloader, ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot, PRIMARY_OUTLET, UrlHandlingStrategy, DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, VERSION, __router_private__ } from './src/index';
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":2,"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["3.3.0-rc.0"]}},"exports":[{"from":"./src/index"}]},{"__symbolic":"module","exports":[{"from":"./src/index"}],"metadata":{"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version"},"arguments":["3.3.0-rc.0"]}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{},"exports":[{"from":"./src/index"}]},{"__symbolic":"module","exports":[{"from":"./src/index"}],"metadata":{},"version":1}]
{
"name": "@angular/router",
"version": "3.3.0-rc.0",
"version": "3.3.0",
"description": "Angular - the routing library",

@@ -24,7 +24,7 @@ "main": "bundles/router.umd.js",

"peerDependencies": {
"@angular/core": "2.3.0-rc.0",
"@angular/common": "2.3.0-rc.0",
"@angular/platform-browser": "2.3.0-rc.0",
"@angular/core": "2.3.0",
"@angular/common": "2.3.0",
"@angular/platform-browser": "2.3.0",
"rxjs": "5.0.0-rc.4"
}
}

@@ -19,16 +19,21 @@ /**

* - `pathMatch` is a string that specifies the matching strategy.
* - `matcher` defines a custom strategy for path matching and supersedes `path` and `pathMatch`.
* See {@link UrlMatcher} for more info.
* - `component` is a component type.
* - `redirectTo` is the url fragment which will replace the current matched segment.
* - `outlet` is the name of the outlet the component should be placed into.
* - `canActivate` is an array of DI tokens used to look up CanActivate handlers. See {@link
* CanActivate} for more info.
* - `canActivate` is an array of DI tokens used to look up CanActivate handlers. See
* {@link CanActivate} for more info.
* - `canActivateChild` is an array of DI tokens used to look up CanActivateChild handlers. See
* {@link
* CanActivateChild} for more info.
* - `canDeactivate` is an array of DI tokens used to look up CanDeactivate handlers. See {@link
* CanDeactivate} for more info.
* {@link CanActivateChild} for more info.
* - `canDeactivate` is an array of DI tokens used to look up CanDeactivate handlers. See
* {@link CanDeactivate} for more info.
* - `canLoad` is an array of DI tokens used to look up CanDeactivate handlers. See
* {@link CanLoad} for more info.
* - `data` is additional data provided to the component via `ActivatedRoute`.
* - `resolve` is a map of DI tokens used to look up data resolvers. See {@link Resolve} for more
* info.
* info.
* - `children` is an array of child route definitions.
* - `loadChildren` is a reference to lazy loaded child routes. See {@link LoadChildren} for more
* info.
*

@@ -40,9 +45,7 @@ * ### Simple Configuration

* path: 'team/:id',
* component: Team,
* children: [
* {
* path: 'user/:name',
* component: User
* }
* ]
* component: Team,
* children: [{
* path: 'user/:name',
* component: User
* }]
* }]

@@ -60,4 +63,3 @@ * ```

* component: Team
* },
* {
* }, {
* path: 'chat/:user',

@@ -89,12 +91,9 @@ * component: Chat

* component: Team,
* children: [
* {
* path: 'legacy/user/:name',
* redirectTo: 'user/:name'
* },
* {
* path: 'user/:name',
* component: User
* }
* ]
* children: [{
* path: 'legacy/user/:name',
* redirectTo: 'user/:name'
* }, {
* path: 'user/:name',
* component: User
* }]
* }]

@@ -119,12 +118,9 @@ * ```

* component: Team,
* children: [
* {
* path: '',
* component: AllUsers
* },
* {
* path: 'user/:name',
* component: User
* }
* ]
* children: [{
* path: '',
* component: AllUsers
* }, {
* path: 'user/:name',
* component: User
* }]
* }]

@@ -141,14 +137,10 @@ * ```

* component: Team,
* children: [
* {
* path: '',
* component: WrapperCmp,
* children: [
* {
* path: 'user/:name',
* component: User
* }
* ]
* }
* ]
* children: [{
* path: '',
* component: WrapperCmp,
* children: [{
* path: 'user/:name',
* component: User
* }]
* }]
* }]

@@ -178,4 +170,3 @@ * ```

* redirectTo: 'main'
* },
* {
* }, {
* path: 'main',

@@ -197,4 +188,3 @@ * component: Main

* redirectTo: 'main'
* },
* {
* }, {
* path: 'main',

@@ -252,4 +242,3 @@ * component: Main

* loading them on demand. The router is designed to make lazy loading simple and easy. Instead of
* providing the children property, you can provide
* the loadChildren property, as follows:
* providing the children property, you can provide the `loadChildren` property, as follows:
*

@@ -265,5 +254,4 @@ * ```

* The router will use registered NgModuleFactoryLoader to fetch an NgModule associated with 'team'.
* Then it will
* extract the set of routes defined in that NgModule, and will transparently add those routes to
* the main configuration.
* Then it will extract the set of routes defined in that NgModule, and will transparently add
* those routes to the main configuration.
*

@@ -332,3 +320,2 @@ * @stable use Routes

* @whatItDoes The type of `loadChildren`.
*
* See {@link Routes} for more details.

@@ -355,5 +342,5 @@ * @stable

resolve?: ResolveData;
children?: Route[];
children?: Routes;
loadChildren?: LoadChildren;
}
export declare function validateConfig(config: Routes): void;
export declare function validateConfig(config: Routes, parentPath?: string): void;

@@ -11,8 +11,12 @@ /**

* @param {?} config
* @param {?=} parentPath
* @return {?}
*/
export function validateConfig(config) {
export function validateConfig(config, parentPath) {
if (parentPath === void 0) { parentPath = ''; }
// forEach doesn't iterate undefined values
for (var /** @type {?} */ i = 0; i < config.length; i++) {
validateNode(config[i]);
var /** @type {?} */ route = config[i];
var /** @type {?} */ fullPath = getFullPath(parentPath, route);
validateNode(route, fullPath);
}

@@ -22,47 +26,72 @@ }

* @param {?} route
* @param {?} fullPath
* @return {?}
*/
function validateNode(route) {
function validateNode(route, fullPath) {
if (!route) {
throw new Error("\n Invalid route configuration: Encountered undefined route.\n The reason might be an extra comma.\n \n Example: \n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n ");
throw new Error("\n Invalid configuration of route '" + fullPath + "': Encountered undefined route.\n The reason might be an extra comma.\n \n Example: \n const routes: Routes = [\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n { path: 'dashboard', component: DashboardComponent },, << two commas\n { path: 'detail/:id', component: HeroDetailComponent }\n ];\n ");
}
if (Array.isArray(route)) {
throw new Error("Invalid route configuration: Array cannot be specified");
throw new Error("Invalid configuration of route '" + fullPath + "': Array cannot be specified");
}
if (route.component === undefined && (route.outlet && route.outlet !== PRIMARY_OUTLET)) {
throw new Error("Invalid route configuration of route '" + route.path + "': a componentless route cannot have a named outlet set");
if (!route.component && (route.outlet && route.outlet !== PRIMARY_OUTLET)) {
throw new Error("Invalid configuration of route '" + fullPath + "': a componentless route cannot have a named outlet set");
}
if (!!route.redirectTo && !!route.children) {
throw new Error("Invalid configuration of route '" + route.path + "': redirectTo and children cannot be used together");
if (route.redirectTo && route.children) {
throw new Error("Invalid configuration of route '" + fullPath + "': redirectTo and children cannot be used together");
}
if (!!route.redirectTo && !!route.loadChildren) {
throw new Error("Invalid configuration of route '" + route.path + "': redirectTo and loadChildren cannot be used together");
if (route.redirectTo && route.loadChildren) {
throw new Error("Invalid configuration of route '" + fullPath + "': redirectTo and loadChildren cannot be used together");
}
if (!!route.children && !!route.loadChildren) {
throw new Error("Invalid configuration of route '" + route.path + "': children and loadChildren cannot be used together");
if (route.children && route.loadChildren) {
throw new Error("Invalid configuration of route '" + fullPath + "': children and loadChildren cannot be used together");
}
if (!!route.redirectTo && !!route.component) {
throw new Error("Invalid configuration of route '" + route.path + "': redirectTo and component cannot be used together");
if (route.redirectTo && route.component) {
throw new Error("Invalid configuration of route '" + fullPath + "': redirectTo and component cannot be used together");
}
if (!!route.path && !!route.matcher) {
throw new Error("Invalid configuration of route '" + route.path + "': path and matcher cannot be used together");
if (route.path && route.matcher) {
throw new Error("Invalid configuration of route '" + fullPath + "': path and matcher cannot be used together");
}
if (route.redirectTo === undefined && !route.component && !route.children &&
!route.loadChildren) {
throw new Error("Invalid configuration of route '" + route.path + "': one of the following must be provided (component or redirectTo or children or loadChildren)");
if (route.redirectTo === void 0 && !route.component && !route.children && !route.loadChildren) {
throw new Error("Invalid configuration of route '" + fullPath + "'. One of the following must be provided: component, redirectTo, children or loadChildren");
}
if (route.path === undefined) {
throw new Error("Invalid route configuration: routes must have path specified");
if (route.path === void 0 && route.matcher === void 0) {
throw new Error("Invalid configuration of route '" + fullPath + "': routes must have either a path or a matcher specified");
}
if (route.path.startsWith('/')) {
throw new Error("Invalid route configuration of route '" + route.path + "': path cannot start with a slash");
if (typeof route.path === 'string' && route.path.charAt(0) === '/') {
throw new Error("Invalid configuration of route '" + fullPath + "': path cannot start with a slash");
}
if (route.path === '' && route.redirectTo !== undefined && route.pathMatch === undefined) {
if (route.path === '' && route.redirectTo !== void 0 && route.pathMatch === void 0) {
var /** @type {?} */ exp = "The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.";
throw new Error("Invalid route configuration of route '{path: \"" + route.path + "\", redirectTo: \"" + route.redirectTo + "\"}': please provide 'pathMatch'. " + exp);
throw new Error("Invalid configuration of route '{path: \"" + fullPath + "\", redirectTo: \"" + route.redirectTo + "\"}': please provide 'pathMatch'. " + exp);
}
if (route.pathMatch !== undefined && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
throw new Error("Invalid configuration of route '" + route.path + "': pathMatch can only be set to 'prefix' or 'full'");
if (route.pathMatch !== void 0 && route.pathMatch !== 'full' && route.pathMatch !== 'prefix') {
throw new Error("Invalid configuration of route '" + fullPath + "': pathMatch can only be set to 'prefix' or 'full'");
}
if (route.children) {
validateConfig(route.children, fullPath);
}
}
/**
* @param {?} parentPath
* @param {?} currentRoute
* @return {?}
*/
function getFullPath(parentPath, currentRoute) {
if (!currentRoute) {
return parentPath;
}
if (!parentPath && !currentRoute.path) {
return '';
}
else if (parentPath && !currentRoute.path) {
return parentPath + "/";
}
else if (!parentPath && currentRoute.path) {
return currentRoute.path;
}
else {
return parentPath + "/" + currentRoute.path;
}
}
//# sourceMappingURL=config.js.map

@@ -19,13 +19,7 @@ /**

* Consider the following route configuration:
* ```
* [{ path: 'user/:name', component: UserCmp }]
* ```
* `[{ path: 'user/:name', component: UserCmp }]`
*
* When linking to this `user/:name` route, you can write:
* `<a routerLink='/user/bob'>link to user component</a>`
*
* ```
* <a routerLink='/user/bob'>link to user component</a>
* ```
*
* @description

@@ -35,8 +29,5 @@ *

*
* Whe the link is static, you can use the directive as follows:
* When the link is static, you can use the directive as follows:
* `<a routerLink="/user/bob">link to user component</a>`
*
* ```
* <a routerLink="/user/bob">link to user component</a>
* ```
*
* If you use dynamic values to generate the link, you can pass an array of path

@@ -48,10 +39,10 @@ * segments, followed by the params for each segment.

*
* Multiple static segments can be merged into one (e.g., `['/team/11/user', userName, {details:
true}]`).
* Multiple static segments can be merged into one
* (e.g., `['/team/11/user', userName, {details: true}]`).
*
* The first segment name can be prepended with `/`, `./`, or `../`:
* * If the first segment begins with `/`, the router will look up the route from the root of the
app.
* app.
* * If the first segment begins with `./`, or doesn't begin with a slash, the router will
* instead look in the children of the current activated route.
* instead look in the children of the current activated route.
* * And if the first segment begins with `../`, the router will go up one level.

@@ -62,4 +53,5 @@ *

* ```
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">link to user
component</a>
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
* link to user component
* </a>
* ```

@@ -71,4 +63,5 @@ * RouterLink will use these to generate this link: `/user/bob#education?debug=true`.

* ```
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>link to user
component</a>
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>
* link to user component
* </a>
* ```

@@ -93,3 +86,2 @@ *

private route;
private locationStrategy;
queryParams: {

@@ -104,3 +96,3 @@ [k: string]: any;

private commands;
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
constructor(router: Router, route: ActivatedRoute);
routerLink: any[] | string;

@@ -129,6 +121,2 @@ onClick(): boolean;

fragment: string;
routerLinkOptions: {
preserveQueryParams: boolean;
preserveFragment: boolean;
};
preserveQueryParams: boolean;

@@ -135,0 +123,0 @@ preserveFragment: boolean;

@@ -16,21 +16,13 @@ /**

* Consider the following route configuration:
* ```
* [{ path: 'user/:name', component: UserCmp }]
* ```
* `[{ path: 'user/:name', component: UserCmp }]`
* *
* When linking to this `user/:name` route, you can write:
* `<a routerLink='/user/bob'>link to user component</a>`
* *
* ```
* <a routerLink='/user/bob'>link to user component</a>
* ```
* *
* *
* The RouterLink directives let you link to specific parts of your app.
* *
* Whe the link is static, you can use the directive as follows:
* When the link is static, you can use the directive as follows:
* `<a routerLink="/user/bob">link to user component</a>`
* *
* ```
* <a routerLink="/user/bob">link to user component</a>
* ```
* *
* If you use dynamic values to generate the link, you can pass an array of path

@@ -42,4 +34,4 @@ * segments, followed by the params for each segment.

* *
* Multiple static segments can be merged into one (e.g., `['/team/11/user', userName, {details:
* true}]`).
* Multiple static segments can be merged into one
* (e.g., `['/team/11/user', userName, {details: true}]`).
* *

@@ -56,4 +48,5 @@ * The first segment name can be prepended with `/`, `./`, or `../`:

* ```
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">link to user
* component</a>
* <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
* link to user component
* </a>
* ```

@@ -65,4 +58,5 @@ * RouterLink will use these to generate this link: `/user/bob#education?debug=true`.

* ```
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>link to user
* component</a>
* <a [routerLink]="['/user/bob']" preserveQueryParams preserveFragment>
* link to user component
* </a>
* ```

@@ -85,8 +79,6 @@ * *

* @param {?} route
* @param {?} locationStrategy
*/
function RouterLink(router, route, locationStrategy) {
function RouterLink(router, route) {
this.router = router;
this.route = route;
this.locationStrategy = locationStrategy;
this.commands = [];

@@ -114,3 +106,7 @@ }

RouterLink.prototype.onClick = function () {
this.router.navigateByUrl(this.urlTree);
var /** @type {?} */ extras = {
skipLocationChange: attrBoolValue(this.skipLocationChange),
replaceUrl: attrBoolValue(this.replaceUrl),
};
this.router.navigateByUrl(this.urlTree, extras);
return true;

@@ -127,6 +123,4 @@ };

fragment: this.fragment,
preserveQueryParams: toBool(this.preserveQueryParams),
preserveFragment: toBool(this.preserveFragment),
skipLocationChange: toBool(this.skipLocationChange),
replaceUrl: toBool(this.replaceUrl),
preserveQueryParams: attrBoolValue(this.preserveQueryParams),
preserveFragment: attrBoolValue(this.preserveFragment),
});

@@ -144,3 +138,2 @@ },

{ type: ActivatedRoute, },
{ type: LocationStrategy, },
]; };

@@ -187,4 +180,2 @@ RouterLink.propDecorators = {

RouterLink.prototype.route;
/** @type {?} */
RouterLink.prototype.locationStrategy;
}

@@ -253,3 +244,7 @@ /**

}
this.router.navigateByUrl(this.urlTree);
var /** @type {?} */ extras = {
skipLocationChange: attrBoolValue(this.skipLocationChange),
replaceUrl: attrBoolValue(this.replaceUrl),
};
this.router.navigateByUrl(this.urlTree, extras);
return false;

@@ -272,6 +267,4 @@ };

fragment: this.fragment,
preserveQueryParams: toBool(this.preserveQueryParams),
preserveFragment: toBool(this.preserveFragment),
skipLocationChange: toBool(this.skipLocationChange),
replaceUrl: toBool(this.replaceUrl),
preserveQueryParams: attrBoolValue(this.preserveQueryParams),
preserveFragment: attrBoolValue(this.preserveFragment),
});

@@ -295,3 +288,2 @@ },

'fragment': [{ type: Input },],
'routerLinkOptions': [{ type: Input },],
'preserveQueryParams': [{ type: Input },],

@@ -324,4 +316,2 @@ 'preserveFragment': [{ type: Input },],

/** @type {?} */
RouterLinkWithHref.prototype.routerLinkOptions;
/** @type {?} */
RouterLinkWithHref.prototype.preserveQueryParams;

@@ -348,10 +338,8 @@ /** @type {?} */

/**
* @param {?=} s
* @param {?} s
* @return {?}
*/
function toBool(s) {
if (s === '')
return true;
return !!s;
function attrBoolValue(s) {
return s === '' || !!s;
}
//# sourceMappingURL=router_link.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":2,"metadata":{"RouterLink":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":":not(a)[routerLink]"}]}],"members":{"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"},{"__symbolic":"reference","module":"@angular/common","name":"LocationStrategy"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",[]]}]}]}},"RouterLinkWithHref":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"a[routerLink]"}]}],"members":{"target":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"routerLinkOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"},{"__symbolic":"reference","module":"@angular/common","name":"LocationStrategy"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]}],"updateTargetUrlAndHref":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","metadata":{"RouterLink":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":":not(a)[routerLink]"}]}],"members":{"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"},{"__symbolic":"reference","module":"@angular/common","name":"LocationStrategy"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",[]]}]}]}},"RouterLinkWithHref":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"a[routerLink]"}]}],"members":{"target":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"routerLinkOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"},{"__symbolic":"reference","module":"@angular/common","name":"LocationStrategy"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]}],"updateTargetUrlAndHref":[{"__symbolic":"method"}]}}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{"RouterLink":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":":not(a)[routerLink]"}]}],"members":{"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",[]]}]}]}},"RouterLinkWithHref":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"a[routerLink]"}]}],"members":{"target":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"},{"__symbolic":"reference","module":"@angular/common","name":"LocationStrategy"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]}],"updateTargetUrlAndHref":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","metadata":{"RouterLink":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":":not(a)[routerLink]"}]}],"members":{"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",[]]}]}]}},"RouterLinkWithHref":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"a[routerLink]"}]}],"members":{"target":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"queryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"fragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveQueryParams":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"preserveFragment":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"skipLocationChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"replaceUrl":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"href":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../router","name":"Router"},{"__symbolic":"reference","module":"../router_state","name":"ActivatedRoute"},{"__symbolic":"reference","module":"@angular/common","name":"LocationStrategy"}]}],"routerLink":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["click",["$event.button","$event.ctrlKey","$event.metaKey"]]}]}],"updateTargetUrlAndHref":[{"__symbolic":"method"}]}}},"version":1}]

@@ -22,2 +22,3 @@ /**

export { DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree } from './url_tree';
export { VERSION } from './version';
export * from './private_export';

@@ -20,3 +20,4 @@ /**

export { DefaultUrlSerializer, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree } from './url_tree';
export { VERSION } from './version';
export { __router_private__ } from './private_export';
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":2,"metadata":{},"exports":[{"from":"./config","export":["Data","LoadChildren","LoadChildrenCallback","ResolveData","Route","Routes"]},{"from":"./directives/router_link","export":["RouterLink","RouterLinkWithHref"]},{"from":"./directives/router_link_active","export":["RouterLinkActive"]},{"from":"./directives/router_outlet","export":["RouterOutlet"]},{"from":"./interfaces","export":["CanActivate","CanActivateChild","CanDeactivate","CanLoad","Resolve"]},{"from":"./route_reuse_strategy","export":["DetachedRouteHandle","RouteReuseStrategy"]},{"from":"./router","export":["Event","NavigationCancel","NavigationEnd","NavigationError","NavigationExtras","NavigationStart","Router","RoutesRecognized"]},{"from":"./router_module","export":["ExtraOptions","ROUTER_CONFIGURATION","ROUTER_INITIALIZER","RouterModule","provideRoutes"]},{"from":"./router_outlet_map","export":["RouterOutletMap"]},{"from":"./router_preloader","export":["NoPreloading","PreloadAllModules","PreloadingStrategy","RouterPreloader"]},{"from":"./router_state","export":["ActivatedRoute","ActivatedRouteSnapshot","RouterState","RouterStateSnapshot"]},{"from":"./shared","export":["PRIMARY_OUTLET","Params"]},{"from":"./url_handling_strategy","export":["UrlHandlingStrategy"]},{"from":"./url_tree","export":["DefaultUrlSerializer","UrlSegment","UrlSegmentGroup","UrlSerializer","UrlTree"]},{"from":"./private_export"}]},{"__symbolic":"module","exports":[{"from":"./config","export":["Data","LoadChildren","LoadChildrenCallback","ResolveData","Route","Routes"]},{"from":"./directives/router_link","export":["RouterLink","RouterLinkWithHref"]},{"from":"./directives/router_link_active","export":["RouterLinkActive"]},{"from":"./directives/router_outlet","export":["RouterOutlet"]},{"from":"./interfaces","export":["CanActivate","CanActivateChild","CanDeactivate","CanLoad","Resolve"]},{"from":"./route_reuse_strategy","export":["DetachedRouteHandle","RouteReuseStrategy"]},{"from":"./router","export":["Event","NavigationCancel","NavigationEnd","NavigationError","NavigationExtras","NavigationStart","Router","RoutesRecognized"]},{"from":"./router_module","export":["ExtraOptions","ROUTER_CONFIGURATION","ROUTER_INITIALIZER","RouterModule","provideRoutes"]},{"from":"./router_outlet_map","export":["RouterOutletMap"]},{"from":"./router_preloader","export":["NoPreloading","PreloadAllModules","PreloadingStrategy","RouterPreloader"]},{"from":"./router_state","export":["ActivatedRoute","ActivatedRouteSnapshot","RouterState","RouterStateSnapshot"]},{"from":"./shared","export":["PRIMARY_OUTLET","Params"]},{"from":"./url_handling_strategy","export":["UrlHandlingStrategy"]},{"from":"./url_tree","export":["DefaultUrlSerializer","UrlSegment","UrlSegmentGroup","UrlSerializer","UrlTree"]},{"from":"./private_export"}],"metadata":{},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{},"exports":[{"from":"./config","export":["Data","LoadChildren","LoadChildrenCallback","ResolveData","Route","Routes"]},{"from":"./directives/router_link","export":["RouterLink","RouterLinkWithHref"]},{"from":"./directives/router_link_active","export":["RouterLinkActive"]},{"from":"./directives/router_outlet","export":["RouterOutlet"]},{"from":"./interfaces","export":["CanActivate","CanActivateChild","CanDeactivate","CanLoad","Resolve"]},{"from":"./route_reuse_strategy","export":["DetachedRouteHandle","RouteReuseStrategy"]},{"from":"./router","export":["Event","NavigationCancel","NavigationEnd","NavigationError","NavigationExtras","NavigationStart","Router","RoutesRecognized"]},{"from":"./router_module","export":["ExtraOptions","ROUTER_CONFIGURATION","ROUTER_INITIALIZER","RouterModule","provideRoutes"]},{"from":"./router_outlet_map","export":["RouterOutletMap"]},{"from":"./router_preloader","export":["NoPreloading","PreloadAllModules","PreloadingStrategy","RouterPreloader"]},{"from":"./router_state","export":["ActivatedRoute","ActivatedRouteSnapshot","RouterState","RouterStateSnapshot"]},{"from":"./shared","export":["PRIMARY_OUTLET","Params"]},{"from":"./url_handling_strategy","export":["UrlHandlingStrategy"]},{"from":"./url_tree","export":["DefaultUrlSerializer","UrlSegment","UrlSegmentGroup","UrlSerializer","UrlTree"]},{"from":"./version","export":["VERSION"]},{"from":"./private_export"}]},{"__symbolic":"module","exports":[{"from":"./config","export":["Data","LoadChildren","LoadChildrenCallback","ResolveData","Route","Routes"]},{"from":"./directives/router_link","export":["RouterLink","RouterLinkWithHref"]},{"from":"./directives/router_link_active","export":["RouterLinkActive"]},{"from":"./directives/router_outlet","export":["RouterOutlet"]},{"from":"./interfaces","export":["CanActivate","CanActivateChild","CanDeactivate","CanLoad","Resolve"]},{"from":"./route_reuse_strategy","export":["DetachedRouteHandle","RouteReuseStrategy"]},{"from":"./router","export":["Event","NavigationCancel","NavigationEnd","NavigationError","NavigationExtras","NavigationStart","Router","RoutesRecognized"]},{"from":"./router_module","export":["ExtraOptions","ROUTER_CONFIGURATION","ROUTER_INITIALIZER","RouterModule","provideRoutes"]},{"from":"./router_outlet_map","export":["RouterOutletMap"]},{"from":"./router_preloader","export":["NoPreloading","PreloadAllModules","PreloadingStrategy","RouterPreloader"]},{"from":"./router_state","export":["ActivatedRoute","ActivatedRouteSnapshot","RouterState","RouterStateSnapshot"]},{"from":"./shared","export":["PRIMARY_OUTLET","Params"]},{"from":"./url_handling_strategy","export":["UrlHandlingStrategy"]},{"from":"./url_tree","export":["DefaultUrlSerializer","UrlSegment","UrlSegmentGroup","UrlSerializer","UrlTree"]},{"from":"./version","export":["VERSION"]},{"from":"./private_export"}],"metadata":{},"version":1}]

@@ -83,3 +83,3 @@ /**

else {
return this.processSegment(config, segmentGroup, 0, segmentGroup.segments, outlet);
return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);
}

@@ -102,3 +102,2 @@ };

* @param {?} segmentGroup
* @param {?} pathIndex
* @param {?} segments

@@ -108,7 +107,7 @@ * @param {?} outlet

*/
Recognizer.prototype.processSegment = function (config, segmentGroup, pathIndex, segments, outlet) {
Recognizer.prototype.processSegment = function (config, segmentGroup, segments, outlet) {
for (var _i = 0, config_1 = config; _i < config_1.length; _i++) {
var r = config_1[_i];
try {
return this.processSegmentAgainstRoute(r, segmentGroup, pathIndex, segments, outlet);
return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);
}

@@ -139,3 +138,2 @@ catch (e) {

* @param {?} rawSegment
* @param {?} pathIndex
* @param {?} segments

@@ -145,3 +143,3 @@ * @param {?} outlet

*/
Recognizer.prototype.processSegmentAgainstRoute = function (route, rawSegment, pathIndex, segments, outlet) {
Recognizer.prototype.processSegmentAgainstRoute = function (route, rawSegment, segments, outlet) {
if (route.redirectTo)

@@ -169,3 +167,3 @@ throw new NoMatch();

else {
var /** @type {?} */ children = this.processSegment(childConfig, segmentGroup, pathIndex + lastChild, slicedSegments, PRIMARY_OUTLET);
var /** @type {?} */ children = this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);
return [new TreeNode(snapshot, children)];

@@ -172,0 +170,0 @@ }

@@ -34,12 +34,9 @@ /**

* component: ParentComponent,
* children: [
* {
* path: 'list',
* component: ListComponent
* },
* {
* path: 'child',
* component: ChildComponent
* }
* ]
* children: [{
* path: 'list',
* component: ListComponent
* },{
* path: 'child',
* component: ChildComponent
* }]
* }]

@@ -443,4 +440,4 @@ * ```

private processNavigations();
private scheduleNavigation(rawUrl, extras);
private executeScheduledNavigation({id, rawUrl, prevRawUrl, extras, resolve, reject});
private scheduleNavigation(rawUrl, imperative, extras);
private executeScheduledNavigation({id, rawUrl, extras, resolve, reject});
private runNavigate(url, rawUrl, shouldPreventPushState, shouldReplaceUrl, id, precreatedState);

@@ -447,0 +444,0 @@ private resetUrlToCurrentUrlTree();

@@ -297,8 +297,18 @@ /**

// which does not work properly with zone.js in IE and Safari
this.locationSubscription = (this.location.subscribe(Zone.current.wrap(function (change) {
var /** @type {?} */ rawUrlTree = _this.urlSerializer.parse(change['url']);
setTimeout(function () {
_this.scheduleNavigation(rawUrlTree, { skipLocationChange: change['pop'], replaceUrl: true });
}, 0);
})));
if (!this.locationSubscription) {
this.locationSubscription = (this.location.subscribe(Zone.current.wrap(function (change) {
var /** @type {?} */ rawUrlTree = _this.urlSerializer.parse(change['url']);
var /** @type {?} */ lastNavigation = _this.navigations.value;
// If the user triggers a navigation imperatively (e.g., by using navigateByUrl),
// and that navigation results in 'replaceState' that leads to the same URL,
// we should skip those.
if (lastNavigation && lastNavigation.imperative &&
lastNavigation.rawUrl.toString() === rawUrlTree.toString()) {
return;
}
setTimeout(function () {
_this.scheduleNavigation(rawUrlTree, false, { skipLocationChange: change['pop'], replaceUrl: true });
}, 0);
})));
}
};

@@ -360,3 +370,8 @@ Object.defineProperty(Router.prototype, "routerState", {

*/
Router.prototype.dispose = function () { this.locationSubscription.unsubscribe(); };
Router.prototype.dispose = function () {
if (this.locationSubscription) {
this.locationSubscription.unsubscribe();
this.locationSubscription = null;
}
};
/**

@@ -439,7 +454,7 @@ * Applies an array of commands to the current url tree and creates a new url tree.

if (url instanceof UrlTree) {
return this.scheduleNavigation(this.urlHandlingStrategy.merge(url, this.rawUrlTree), extras);
return this.scheduleNavigation(this.urlHandlingStrategy.merge(url, this.rawUrlTree), true, extras);
}
else {
var /** @type {?} */ urlTree = this.urlSerializer.parse(url);
return this.scheduleNavigation(this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree), extras);
return this.scheduleNavigation(this.urlHandlingStrategy.merge(urlTree, this.rawUrlTree), true, extras);
}

@@ -539,10 +554,7 @@ };

* @param {?} rawUrl
* @param {?} imperative
* @param {?} extras
* @return {?}
*/
Router.prototype.scheduleNavigation = function (rawUrl, extras) {
var /** @type {?} */ prevRawUrl = this.navigations.value ? this.navigations.value.rawUrl : null;
if (prevRawUrl && prevRawUrl.toString() === rawUrl.toString()) {
return this.navigations.value.promise;
}
Router.prototype.scheduleNavigation = function (rawUrl, imperative, extras) {
var /** @type {?} */ resolve = null;

@@ -555,3 +567,3 @@ var /** @type {?} */ reject = null;

var /** @type {?} */ id = ++this.navigationId;
this.navigations.next({ id: id, rawUrl: rawUrl, prevRawUrl: prevRawUrl, extras: extras, resolve: resolve, reject: reject, promise: promise });
this.navigations.next({ id: id, imperative: imperative, rawUrl: rawUrl, extras: extras, resolve: resolve, reject: reject, promise: promise });
// Make sure that the error is propagated even though `processNavigations` catch

@@ -567,6 +579,5 @@ // handler does not rethrow

var _this = this;
var id = _a.id, rawUrl = _a.rawUrl, prevRawUrl = _a.prevRawUrl, extras = _a.extras, resolve = _a.resolve, reject = _a.reject;
var id = _a.id, rawUrl = _a.rawUrl, extras = _a.extras, resolve = _a.resolve, reject = _a.reject;
var /** @type {?} */ url = this.urlHandlingStrategy.extract(rawUrl);
var /** @type {?} */ prevUrl = prevRawUrl ? this.urlHandlingStrategy.extract(prevRawUrl) : null;
var /** @type {?} */ urlTransition = !prevUrl || url.toString() !== prevUrl.toString();
var /** @type {?} */ urlTransition = !this.navigated || url.toString() !== this.currentUrlTree.toString();
if (urlTransition && this.urlHandlingStrategy.shouldProcessUrl(rawUrl)) {

@@ -578,3 +589,4 @@ this.routerEvents.next(new NavigationStart(id, this.serializeUrl(url)));

}
else if (urlTransition && prevRawUrl && this.urlHandlingStrategy.shouldProcessUrl(prevRawUrl)) {
else if (urlTransition && this.rawUrlTree &&
this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)) {
this.routerEvents.next(new NavigationStart(id, this.serializeUrl(url)));

@@ -581,0 +593,0 @@ Promise.resolve()

@@ -39,2 +39,10 @@ /**

};
export declare function initialRouterNavigation(ngUpgrade: UpgradeModule, ref: ApplicationRef, preloader: RouterPreloader, opts: ExtraOptions): Function;
/**
* @whatItDoes Sets up a location synchronization.
*
* History.pushState does not fire onPopState, so the angular2 location
* doesn't detect it. The workaround is to attach a location change listener
*
* @experimental
*/
export declare function setUpLocationSync(ngUpgrade: UpgradeModule): void;

@@ -39,4 +39,10 @@ /**

};
/**
* @internal
*/
export function initialRouterNavigation(ngUpgrade, ref, preloader, opts) {
return function () {
if (!ngUpgrade.$injector) {
throw new Error("\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n ");
}
var router = ngUpgrade.injector.get(Router);

@@ -50,15 +56,24 @@ var ref = ngUpgrade.injector.get(ApplicationRef);

else {
setTimeout(function () { router.initialNavigation(); }, 0);
router.initialNavigation();
}
// History.pushState does not fire onPopState, so the angular2 location
// doesn't detect it. The workaround is to attach a location change listener
// that will call navigate directly.
ngUpgrade.$injector.get('$rootScope')
.$on('$locationChangeStart', function (_, next, __) {
var url = document.createElement('a');
url.href = next;
router.navigateByUrl(url.pathname);
});
setUpLocationSync(ngUpgrade);
};
}
/**
* @whatItDoes Sets up a location synchronization.
*
* History.pushState does not fire onPopState, so the angular2 location
* doesn't detect it. The workaround is to attach a location change listener
*
* @experimental
*/
export function setUpLocationSync(ngUpgrade) {
var router = ngUpgrade.injector.get(Router);
var url = document.createElement('a');
ngUpgrade.$injector.get('$rootScope')
.$on('$locationChangeStart', function (_, next, __) {
url.href = next;
router.navigateByUrl(url.pathname);
});
}
//# sourceMappingURL=upgrade.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":2,"metadata":{"RouterUpgradeInitializer":{"provide":{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_INITIALIZER"},"useFactory":{"__symbolic":"reference","name":"initialRouterNavigation"},"deps":[{"__symbolic":"reference","module":"@angular/upgrade/static","name":"UpgradeModule"},{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef"},{"__symbolic":"reference","module":"@angular/router","name":"RouterPreloader"},{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_CONFIGURATION"}]},"initialRouterNavigation":{"__symbolic":"function","parameters":["ngUpgrade","ref","preloader","opts"],"value":{"__symbolic":"error","message":"Function call not supported","line":45,"character":9}}}},{"__symbolic":"module","metadata":{"RouterUpgradeInitializer":{"provide":{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_INITIALIZER"},"useFactory":{"__symbolic":"reference","name":"initialRouterNavigation"},"deps":[{"__symbolic":"reference","module":"@angular/upgrade/static","name":"UpgradeModule"},{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef"},{"__symbolic":"reference","module":"@angular/router","name":"RouterPreloader"},{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_CONFIGURATION"}]},"initialRouterNavigation":{"__symbolic":"function","parameters":["ngUpgrade","ref","preloader","opts"],"value":{"__symbolic":"error","message":"Function call not supported","line":45,"character":9}}},"version":1}]
[{"__symbolic":"module","version":2,"metadata":{"RouterUpgradeInitializer":{"provide":{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_INITIALIZER"},"useFactory":{"__symbolic":"reference","name":"initialRouterNavigation"},"deps":[{"__symbolic":"reference","module":"@angular/upgrade/static","name":"UpgradeModule"},{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef"},{"__symbolic":"reference","module":"@angular/router","name":"RouterPreloader"},{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_CONFIGURATION"}]},"initialRouterNavigation":{"__symbolic":"function","parameters":["ngUpgrade","ref","preloader","opts"],"value":{"__symbolic":"error","message":"Function call not supported","line":48,"character":9}},"setUpLocationSync":{"__symbolic":"function"}}},{"__symbolic":"module","metadata":{"RouterUpgradeInitializer":{"provide":{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_INITIALIZER"},"useFactory":{"__symbolic":"reference","name":"initialRouterNavigation"},"deps":[{"__symbolic":"reference","module":"@angular/upgrade/static","name":"UpgradeModule"},{"__symbolic":"reference","module":"@angular/core","name":"ApplicationRef"},{"__symbolic":"reference","module":"@angular/router","name":"RouterPreloader"},{"__symbolic":"reference","module":"@angular/router","name":"ROUTER_CONFIGURATION"}]},"initialRouterNavigation":{"__symbolic":"function","parameters":["ngUpgrade","ref","preloader","opts"],"value":{"__symbolic":"error","message":"Function call not supported","line":48,"character":9}},"setUpLocationSync":{"__symbolic":"function"}},"version":1}]

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc