Moving Docs and Faq to separate lazy loaded module

This commit is contained in:
softsimon
2022-04-24 22:53:27 +04:00
parent bf314be7eb
commit 9b4c6b9e2c
19 changed files with 118 additions and 101 deletions

View File

@@ -0,0 +1,58 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DocsComponent } from './docs/docs.component';
const browserWindow = window || {};
// @ts-ignore
const browserWindowEnv = browserWindow.__env || {};
let routes: Routes = [];
if (browserWindowEnv.BASE_MODULE && (browserWindowEnv.BASE_MODULE === 'bisq' || browserWindowEnv.BASE_MODULE === 'liquid')) {
routes = [
{
path: '',
redirectTo: 'api/rest'
},
{
path: 'api/:type',
component: DocsComponent
},
{
path: 'api',
redirectTo: 'api/rest'
},
{
path: '**',
redirectTo: 'api/rest'
}
];
} else {
routes = [
{
path: '',
redirectTo: 'faq'
},
{
path: 'api/:type',
component: DocsComponent
},
{
path: 'faq',
component: DocsComponent
},
{
path: 'api',
redirectTo: 'api/rest'
},
{
path: '**',
redirectTo: 'api/faq'
}
];
}
@NgModule({
imports: [RouterModule.forChild(routes)],
})
export class DocsRoutingModule { }