mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-29 13:34:20 +00:00
Dynamic routing strategy, fixed for AOT changes
This commit is contained in:
parent
faf214ea40
commit
910fa5ae33
@ -24,17 +24,17 @@ const routes: Routes = [
|
||||
{ path: 'server/:server_id/project/:project_id', component: ProjectMapComponent },
|
||||
];
|
||||
|
||||
let routerModule;
|
||||
// AOT in production requires to have exported symbol
|
||||
export let extraOptions = null;
|
||||
if (environment.electron) {
|
||||
// angular in electron has problem with base-href and links separated by slashes, because of that
|
||||
// we use simply hashes
|
||||
routerModule = RouterModule.forRoot(routes, {useHash: true});
|
||||
} else {
|
||||
routerModule = RouterModule.forRoot(routes);
|
||||
extraOptions = { useHash: true };
|
||||
}
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [ routerModule ],
|
||||
imports: [ RouterModule.forRoot(routes, extraOptions)],
|
||||
exports: [ RouterModule ]
|
||||
})
|
||||
export class AppRoutingModule {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user