From b28aeab50d9bec838a19c9e86fd9c3e167ba7cb4 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Fri, 7 Sep 2018 16:03:03 +0200 Subject: [PATCH] feat(router): add support for relative paths fixes #15499 --- core/src/components/router/router.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/components/router/router.tsx b/core/src/components/router/router.tsx index 16f52a8c6a..8a43502610 100644 --- a/core/src/components/router/router.tsx +++ b/core/src/components/router/router.tsx @@ -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);