fix(location): improve the 'No base href set' error message
This commit is contained in:
parent
dea6a4593b
commit
15ab6f6ea8
|
@ -89,7 +89,7 @@ export class Location {
|
||||||
|
|
||||||
if (isBlank(browserBaseHref)) {
|
if (isBlank(browserBaseHref)) {
|
||||||
throw new BaseException(
|
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));
|
this._baseHref = stripTrailingSlash(stripIndexHtml(browserBaseHref));
|
||||||
|
|
|
@ -81,7 +81,7 @@ export function main() {
|
||||||
locationStrategy.internalBaseHref = null;
|
locationStrategy.internalBaseHref = null;
|
||||||
expect(() => new Location(locationStrategy))
|
expect(() => new Location(locationStrategy))
|
||||||
.toThrowError(
|
.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', () => {
|
it('should revert to the previous path when a back() operation is executed', () => {
|
||||||
|
|
Loading…
Reference in New Issue