I need to bypass the Angular routing for a specific relative route, e g '/register', but I can't seem to find a way to instruct Angular's RouterModule to NOT process a specific relative route.
Any non-specified route will be caught by the RouterModule and redirected to '/' even though I don't have a wild card route set.
I've tried both the dev server and a real linux server.
This question has been asked before, but no satisfying answer has been provided.
Here's a simplified version of what my current routing code looks like:
export const module_page1_path = 'page1.module';
export const module_page2_path = 'page2.module';
const createImportFunction = (path: string, moduleName: string) => () =>
import('./' + path).then(mod => mod[moduleName]);
export const appRoutes: Routes = [
{
path: 'page1',
loadChildren: createImportFunction(module_page1_path, 'Page1Module')
},
{
path: 'page2',
loadChildren: createImportFunction(module_page2_path, 'Page2Module'),
canActivate: [AuthGuardService]
},
{
path: 'callback',
component: AuthCallbackComponent
},
{
path: 'index.html',
redirectTo: 'page1',
pathMatch: 'full'
}
,
{
path: '',
redirectTo: 'page1',
pathMatch: 'full'
},
];
@NgModule({
imports: [RouterModule.forRoot(appRoutes)],
exports: [RouterModule]
})
export class AppRoutingModule {
}
So I would like the user to access a server generated page called 'register' on the same domain, which should take the user away from the Angular app.
How do I do that?