Skip to content

Commit

Permalink
feat(router): add support for relative paths
Browse files Browse the repository at this point in the history
fixes #15499
  • Loading branch information
manucorporat committed Sep 7, 2018
1 parent 11d4fb9 commit b28aeab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/components/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b28aeab

Please sign in to comment.