From 15ab6f6ea8ec6ae3c8ad6256417f46f958517847 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 6 Oct 2015 20:58:38 -0700 Subject: [PATCH] fix(location): improve the 'No base href set' error message --- modules/angular2/src/router/location.ts | 2 +- modules/angular2/test/router/location_spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/angular2/src/router/location.ts b/modules/angular2/src/router/location.ts index 9bff5a80ba..4c65d871a2 100644 --- a/modules/angular2/src/router/location.ts +++ b/modules/angular2/src/router/location.ts @@ -89,7 +89,7 @@ export class Location { if (isBlank(browserBaseHref)) { throw new BaseException( - `No base href set. Either provide a binding to "appBaseHrefToken" or add a base element.`); + `No base href set. Either provide a binding for the APP_BASE_HREF token or add a base element to the document.`); } this._baseHref = stripTrailingSlash(stripIndexHtml(browserBaseHref)); diff --git a/modules/angular2/test/router/location_spec.ts b/modules/angular2/test/router/location_spec.ts index 6b2fb99944..6b3272b019 100644 --- a/modules/angular2/test/router/location_spec.ts +++ b/modules/angular2/test/router/location_spec.ts @@ -81,7 +81,7 @@ export function main() { locationStrategy.internalBaseHref = null; expect(() => new Location(locationStrategy)) .toThrowError( - `No base href set. Either provide a binding to "appBaseHrefToken" or add a base element.`); + `No base href set. Either provide a binding for the APP_BASE_HREF token or add a base element to the document.`); }); it('should revert to the previous path when a back() operation is executed', () => {