fix(router): do not prepend the root URL with a starting slash

This commit is contained in:
Matias Niemelä
2015-06-12 11:29:31 -07:00
committed by Brian Ford
parent 6834c4992d
commit e372cc779d
2 changed files with 4 additions and 1 deletions

View File

@ -21,7 +21,7 @@ export class Location {
normalize(url: string): string { return this._stripBaseHref(stripIndexHtml(url)); }
normalizeAbsolutely(url: string): string {
if (url[0] != '/') {
if (url.length > 0 && url[0] != '/') {
url = '/' + url;
}
return this._addBaseHref(url);