@angular/router
Advanced tools
Comparing version 3.1.0 to 3.1.1
/** | ||
* @license Angular v3.1.0 | ||
* @license Angular v3.1.1 | ||
* (c) 2010-2016 Google, Inc. https://angular.io/ | ||
@@ -51,7 +51,26 @@ * License: MIT | ||
*/ | ||
this.stubbedModules = {}; | ||
this._stubbedModules = {}; | ||
} | ||
Object.defineProperty(SpyNgModuleFactoryLoader.prototype, "stubbedModules", { | ||
/** | ||
* @docsNotRequired | ||
*/ | ||
get: function () { return this._stubbedModules; }, | ||
/** | ||
* @docsNotRequired | ||
*/ | ||
set: function (modules) { | ||
var res = {}; | ||
for (var _i = 0, _a = Object.keys(modules); _i < _a.length; _i++) { | ||
var t = _a[_i]; | ||
res[t] = this.compiler.compileModuleAsync(modules[t]); | ||
} | ||
this._stubbedModules = res; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
SpyNgModuleFactoryLoader.prototype.load = function (path) { | ||
if (this.stubbedModules[path]) { | ||
return this.compiler.compileModuleAsync(this.stubbedModules[path]); | ||
if (this._stubbedModules[path]) { | ||
return this._stubbedModules[path]; | ||
} | ||
@@ -58,0 +77,0 @@ else { |
{ | ||
"name": "@angular/router", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Angular - the routing library", | ||
@@ -24,7 +24,7 @@ "main": "bundles/router.umd.js", | ||
"peerDependencies": { | ||
"@angular/core": "2.1.0", | ||
"@angular/common": "2.1.0", | ||
"@angular/platform-browser": "2.1.0", | ||
"@angular/core": "2.1.1", | ||
"@angular/common": "2.1.1", | ||
"@angular/platform-browser": "2.1.1", | ||
"rxjs": "5.0.0-beta.12" | ||
} | ||
} |
@@ -147,3 +147,3 @@ /** | ||
if (route.path === '**') { | ||
return this.expandWildCardWithParamsAgainstRouteUsingRedirect(route); | ||
return this.expandWildCardWithParamsAgainstRouteUsingRedirect(injector, routes, route, outlet); | ||
} | ||
@@ -154,3 +154,3 @@ else { | ||
}; | ||
ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect = function (route) { | ||
ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect = function (injector, routes, route, outlet) { | ||
var newSegments = applyRedirectCommands([], route.redirectTo, {}); | ||
@@ -161,3 +161,4 @@ if (route.redirectTo.startsWith('/')) { | ||
else { | ||
return of(new UrlSegmentGroup(newSegments, {})); | ||
var group = new UrlSegmentGroup(newSegments, {}); | ||
return this.expandSegment(injector, group, routes, newSegments, outlet, false); | ||
} | ||
@@ -164,0 +165,0 @@ }; |
@@ -163,2 +163,4 @@ /** | ||
function getPath(command) { | ||
if (typeof command === 'object' && command.outlets) | ||
return command.outlets[PRIMARY_OUTLET]; | ||
return "" + command; | ||
@@ -182,4 +184,10 @@ } | ||
var m = prefixedWith(segmentGroup, startIndex, commands); | ||
var slicedCommands = commands.slice(m.lastIndex); | ||
if (m.match && slicedCommands.length === 0) { | ||
var slicedCommands = commands.slice(m.commandIndex); | ||
if (m.match && m.pathIndex < segmentGroup.segments.length) { | ||
var g = new UrlSegmentGroup(segmentGroup.segments.slice(0, m.pathIndex), {}); | ||
g.children[PRIMARY_OUTLET] = | ||
new UrlSegmentGroup(segmentGroup.segments.slice(m.pathIndex), segmentGroup.children); | ||
return updateSegmentGroupChildren(g, 0, slicedCommands); | ||
} | ||
else if (m.match && slicedCommands.length === 0) { | ||
return new UrlSegmentGroup(segmentGroup.segments, {}); | ||
@@ -220,3 +228,3 @@ } | ||
var currentPathIndex = startIndex; | ||
var noMatch = { match: false, lastIndex: 0 }; | ||
var noMatch = { match: false, pathIndex: 0, commandIndex: 0 }; | ||
while (currentPathIndex < segmentGroup.segments.length) { | ||
@@ -228,2 +236,4 @@ if (currentCommandIndex >= commands.length) | ||
var next = currentCommandIndex < commands.length - 1 ? commands[currentCommandIndex + 1] : null; | ||
if (currentPathIndex > 0 && curr === undefined) | ||
break; | ||
if (curr && next && (typeof next === 'object') && next.outlets === undefined) { | ||
@@ -241,3 +251,3 @@ if (!compare(curr, next, path)) | ||
} | ||
return { match: true, lastIndex: currentCommandIndex }; | ||
return { match: true, pathIndex: currentPathIndex, commandIndex: currentCommandIndex }; | ||
} | ||
@@ -244,0 +254,0 @@ function createNewSegmentGroup(segmentGroup, startIndex, commands) { |
@@ -17,3 +17,3 @@ /** | ||
* ``` | ||
* <a [routerLink]='/user/bob' routerLinkActive='active-link'>Bob</a> | ||
* <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a> | ||
* ``` | ||
@@ -29,3 +29,3 @@ * | ||
* ``` | ||
* <a [routerLink]="/user/bob" routerLinkActive="active-link">Bob</a> | ||
* <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a> | ||
* ``` | ||
@@ -39,4 +39,4 @@ * | ||
* ``` | ||
* <a [routerLink]="/user/bob" routerLinkActive="class1 class2">Bob</a> | ||
* <a [routerLink]="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a> | ||
* <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a> | ||
* <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a> | ||
* ``` | ||
@@ -48,3 +48,3 @@ * | ||
* ``` | ||
* <a [routerLink]="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: | ||
* <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: | ||
* true}">Bob</a> | ||
@@ -57,4 +57,4 @@ * ``` | ||
* <div routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: true}"> | ||
* <a [routerLink]="/user/jim">Jim</a> | ||
* <a [routerLink]="/user/bob">Bob</a> | ||
* <a routerLink="/user/jim">Jim</a> | ||
* <a routerLink="/user/bob">Bob</a> | ||
* </div> | ||
@@ -61,0 +61,0 @@ * ``` |
@@ -17,3 +17,3 @@ /** | ||
* ``` | ||
* <a [routerLink]='/user/bob' routerLinkActive='active-link'>Bob</a> | ||
* <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a> | ||
* ``` | ||
@@ -29,3 +29,3 @@ * | ||
* ``` | ||
* <a [routerLink]="/user/bob" routerLinkActive="active-link">Bob</a> | ||
* <a routerLink="/user/bob" routerLinkActive="active-link">Bob</a> | ||
* ``` | ||
@@ -39,4 +39,4 @@ * | ||
* ``` | ||
* <a [routerLink]="/user/bob" routerLinkActive="class1 class2">Bob</a> | ||
* <a [routerLink]="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a> | ||
* <a routerLink="/user/bob" routerLinkActive="class1 class2">Bob</a> | ||
* <a routerLink="/user/bob" [routerLinkActive]="['class1', 'class2']">Bob</a> | ||
* ``` | ||
@@ -48,3 +48,3 @@ * | ||
* ``` | ||
* <a [routerLink]="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: | ||
* <a routerLink="/user/bob" routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: | ||
* true}">Bob</a> | ||
@@ -57,4 +57,4 @@ * ``` | ||
* <div routerLinkActive="active-link" [routerLinkActiveOptions]="{exact: true}"> | ||
* <a [routerLink]="/user/jim">Jim</a> | ||
* <a [routerLink]="/user/bob">Bob</a> | ||
* <a routerLink="/user/jim">Jim</a> | ||
* <a routerLink="/user/bob">Bob</a> | ||
* </div> | ||
@@ -61,0 +61,0 @@ * ``` |
@@ -45,2 +45,9 @@ /** | ||
*/ | ||
private _stubbedModules; | ||
/** | ||
* @docsNotRequired | ||
*/ | ||
/** | ||
* @docsNotRequired | ||
*/ | ||
stubbedModules: { | ||
@@ -47,0 +54,0 @@ [path: string]: any; |
@@ -48,7 +48,26 @@ /** | ||
*/ | ||
this.stubbedModules = {}; | ||
this._stubbedModules = {}; | ||
} | ||
Object.defineProperty(SpyNgModuleFactoryLoader.prototype, "stubbedModules", { | ||
/** | ||
* @docsNotRequired | ||
*/ | ||
get: function () { return this._stubbedModules; }, | ||
/** | ||
* @docsNotRequired | ||
*/ | ||
set: function (modules) { | ||
var res = {}; | ||
for (var _i = 0, _a = Object.keys(modules); _i < _a.length; _i++) { | ||
var t = _a[_i]; | ||
res[t] = this.compiler.compileModuleAsync(modules[t]); | ||
} | ||
this._stubbedModules = res; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
SpyNgModuleFactoryLoader.prototype.load = function (path) { | ||
if (this.stubbedModules[path]) { | ||
return this.compiler.compileModuleAsync(this.stubbedModules[path]); | ||
if (this._stubbedModules[path]) { | ||
return this._stubbedModules[path]; | ||
} | ||
@@ -55,0 +74,0 @@ else { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
816001
10971