From 289b98f4ecce88205f17c40670c71df8ebcdbba5 Mon Sep 17 00:00:00 2001 From: Emmanuel Potvin Date: Fri, 4 Dec 2015 22:51:42 -0500 Subject: [PATCH] fix(RootRouter): Path prefixed with a slash when not needed Add a condition to avoid prefixing a second slash at the beginning of the path there is already one. Closes #5627 --- modules/angular2/src/router/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/angular2/src/router/router.ts b/modules/angular2/src/router/router.ts index aec01f52d9a8..8eb985046016 100644 --- a/modules/angular2/src/router/router.ts +++ b/modules/angular2/src/router/router.ts @@ -464,7 +464,7 @@ export class RootRouter extends Router { commit(instruction: Instruction, _skipLocationChange: boolean = false): Promise { var emitPath = instruction.toUrlPath(); var emitQuery = instruction.toUrlQuery(); - if (emitPath.length > 0) { + if (emitPath.length > 0 && emitPath.substring(0, 1) != '/') { emitPath = '/' + emitPath; } var promise = super.commit(instruction);