We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created a new app with a router + child router with the following routes:
main.ts
import Aurelia from 'aurelia'; import { RouterConfiguration } from '@aurelia/router'; import { MyApp } from './my-app'; Aurelia.register(RouterConfiguration.customize({ useUrlFragmentHash: true })) .app(MyApp) .start();
my-app.ts
import { HomePage } from './routes/home-page'; @routes([ { path: '', redirectTo: 'home' }, { path: 'home', component: () => HomePage01, title: 'Home', }, ])
home-page.ts
import { ChildPage01 } from './child/child-page-01'; @routes([ { path: '', redirectTo: 'child' }, { path: 'child', component: ChildPage01, title: 'Child Page', }, ])
So when the app opens in the browser for the first time the url is: /#/home/child.
/#/home/child
However, if the routes are lazily loaded:
@routes([ { path: '', redirectTo: 'home' }, { path: 'home', component: () => import('./routes/home-page'), title: 'Home', }, ])
@routes([ { path: '', redirectTo: 'child' }, { path: 'child', component: () => import('./child/child-page-01'), title: 'Child Page', }, ])
The url is this /# when the app is loaded for the first time and the child route is not loaded.
/#
Repro links: Normal loaded routes: https://stackblitz.com/edit/au2-router-p1wmzl?file=src/routes/home-page.ts Lazy loaded routes: https://stackblitz.com/edit/au2-router-gxy16b?file=src/routes/home-page.ts
The text was updated successfully, but these errors were encountered:
This works in the latest release, please update.
Sorry, something went wrong.
Super. I updated to 2.0.0-alpha.41 and it worked.
2.0.0-alpha.41
I noticed a different problem though. If I add in this to home-page.ts:
loading(params, instruction) { let p = new Promise((resolve, reject) => { setTimeout(() => { resolve(undefined); }, 1000); }); return p; }
it doesn't work anymore. This is the case for both versions (normal loading and lazy loading). (I updated the stackblitz examples)
works without redirectTo
redirectTo
path: ['', 'child'],
jwx
No branches or pull requests
馃悰 Bug Report
Created a new app with a router + child router with the following routes:
main.ts
my-app.ts
home-page.ts
So when the app opens in the browser for the first time the url is:
/#/home/child
.However, if the routes are lazily loaded:
my-app.ts
home-page.ts
The url is this
/#
when the app is loaded for the first time and the child route is not loaded.Repro links:
Normal loaded routes: https://stackblitz.com/edit/au2-router-p1wmzl?file=src/routes/home-page.ts
Lazy loaded routes: https://stackblitz.com/edit/au2-router-gxy16b?file=src/routes/home-page.ts
The text was updated successfully, but these errors were encountered: