In my PWA there’s a login page and now I want to navigate by URL to a second page. I’m using the following code in app-routing.module.ts:
const routes: Routes = [
{
path: 'login',
loadChildren: () => import('./pages/login/login.module').then( m => m.LoginPageModule)
},
{
path: '',
redirectTo: 'login',
pathMatch: 'full'
},
{
path: 'menu',
loadChildren: () => import('./pages/menu/menu.module').then( m => m.MenuPageModule),
canActivate: [AuthService]
},
{
path: 'registration',
loadChildren: () => import('./pages/registration/registration.module').then( m => m.NeuanmeldungPageModule)
},
];
The problem is now, that if I call the URL (e.g. https://pwa.myurl.ex) of my PWA first and then the registration URL (e.g. https://pwa.myurl.ex/registration) everything works. But if I clear the cache of my device or browser and call https://pwa.myurl.ex/registration first I get a 404 error.
What’s wrong? Can you help me? Thanks in advance!