feat(router): add support for relative paths

fixes #15499
This commit is contained in:
Manu Mtz.-Almeida
2018-09-07 16:03:03 +02:00
parent 11d4fb97a7
commit b28aeab50d

View File

@ -89,6 +89,9 @@ export class Router {
/** Navigate to the specified URL */
@Method()
push(url: string, direction: RouterDirection = 'forward') {
if (url.startsWith('.')) {
url = (new URL(url, window.location.href)).pathname;
}
console.debug('[ion-router] URL pushed -> updating nav', url, direction);
const path = parsePath(url);