Angular 9: Ленивая загрузка / маршрутизатор не работает должным образом
Сообщения об ошибках консоли
Path URL: /author
http://local.xxxxx.com/node/190/author
Code
app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app/app.component';
import { HomeComponent } from './home/home.component';
import { BlankComponent } from './blank/blank.component';
const childRoutes = [
{
path: 'author/preview',
data: {
routeLabel: 'preview'
},
loadChildren: () => import('./frame/frame.module').then(m => m.FrameModule)
},
{
path: 'author',
canActivate: [DraftContentGuard, ContentEditorAccessGuard],
data: {
routeLabel: 'edit'
},
loadChildren: () => import('./frame/frame.module').then(m => m.FrameModule)
},
];
const routes: Routes = [
{
path: ':locale/:type/:contentId',
component: AppComponent,
canActivate: [EnabledWebSegmentAccessGuard],
children: childRoutes
},
{path: 'author', component: HomeComponent},
{path: '', redirectTo: '/author', pathMatch: 'full'},
{path: '**', component: BlankComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes, {paramsInheritanceStrategy: 'always'})],
exports: [RouterModule]
})
export class AppRoutingModule { }
frame.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FrameRoutingModule } from './frame-routing.module';
import { FrameComponent } from './frame.component';
@NgModule({
imports: [
CommonModule,
FrameRoutingModule
],
declarations: [FrameComponent]
})
export class FrameModule { }
frame-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FrameComponent } from './frame.component';
const routes: Routes = [
{
path: '',
component: FrameComponent,
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class FrameRoutingModule { }
Структура проекта
What do I think?
The majority of the documentation, articles, tutorials, are using a different localhost server, so I am not sure if my server configuration should change to work properly with the lazy loading.
Файла нет на моем сервере