【发布时间】:2020-09-18 22:33:37
【问题描述】:
我正在尝试集成 django 和 angular4,但在控制台中我得到了
错误:加载块 1 失败。
我知道问题出在哪里,但我无法解决。
这是我的 app.routing.ts
import { Routes } from '@angular/router';
import { AdminLayoutComponent } from './layouts/admin/admin-layout.component';
import { AuthLayoutComponent } from './layouts/auth/auth-layout.component';
export const AppRoutes: Routes = [{
path: '',
component: AdminLayoutComponent,
children: [{
path: '',
loadChildren: './dashboard/dashboard.module#DashboardModule'
}, {
path: 'email',
loadChildren: './email/email.module#EmailModule'
}, {
path: 'components',
loadChildren: './components/components.module#ComponentsModule'
}]
}, {
path: '',
component: AuthLayoutComponent,
children: [{
path: 'authentication',
loadChildren: './authentication/authentication.module#AuthenticationModule'
}, {
path: 'error',
loadChildren: './error/error.module#ErrorModule'
}, {
path: 'landing',
loadChildren: './landing/landing.module#LandingModule'
}]
}, {
path: '**',
redirectTo: 'error/404'
}];
它可以在没有子节点的情况下工作,但延迟加载块不会在 django 中加载。 任何帮助将不胜感激。
【问题讨论】:
标签: django angular lazy-loading