Revert "fix(compiler): support string tokens with . inside."

This reverts commit 67c80fbb5e.
This commit is contained in:
Misko Hevery
2016-05-24 20:30:27 -07:00
parent 6dc88f5b61
commit d5f5ce82ca
2 changed files with 15 additions and 68 deletions

View File

@ -9,7 +9,6 @@ import {RouterOutlet} from './directives/router_outlet';
import {getCanActivateHook} from './lifecycle/route_lifecycle_reflector';
import {RouteDefinition} from './route_config/route_config_impl';
import {Injectable, Inject} from '@angular/core';
import {DefaultInstruction} from "./instruction";
let _resolveToTrue = PromiseWrapper.resolve(true);
let _resolveToFalse = PromiseWrapper.resolve(false);
@ -132,9 +131,8 @@ export class Router {
*/
isRouteActive(instruction: Instruction): boolean {
var router: Router = this;
var currentInstruction = this.currentInstruction;
if (isBlank(currentInstruction)) {
if (isBlank(this.currentInstruction)) {
return false;
}
@ -144,28 +142,22 @@ export class Router {
instruction = instruction.child;
}
let reason = true;
if (isBlank(instruction.component) || isBlank(this.currentInstruction.component) ||
this.currentInstruction.component.routeName != instruction.component.routeName) {
return false;
}
// check the instructions in depth
do {
if (isBlank(instruction.component) || isBlank(currentInstruction.component) ||
currentInstruction.component.routeName != instruction.component.routeName) {
return false;
}
if (isPresent(instruction.component.params)) {
StringMapWrapper.forEach(instruction.component.params, (value, key) => {
if (currentInstruction.component.params[key] !== value) {
reason = false;
}
});
}
currentInstruction = currentInstruction.child;
instruction = instruction.child;
} while (isPresent(currentInstruction) && isPresent(instruction) &&
!(instruction instanceof DefaultInstruction) && reason);
let paramEquals = true;
// ignore DefaultInstruction
return reason && (isBlank(instruction) || instruction instanceof DefaultInstruction);
if (isPresent(this.currentInstruction.component.params)) {
StringMapWrapper.forEach(instruction.component.params, (value, key) => {
if (this.currentInstruction.component.params[key] !== value) {
paramEquals = false;
}
});
}
return paramEquals;
}