我正在使用角度负载来装载我的模块,下面是我的路线:
{
pathMatch: 'full',
path: '',
loadChildren: () => import('./pages/landing/home-page/home-page.module').then(m => m.HomePageModule)
},
{
path: 'web-design',
loadChildren: () => import('./pages/landing/web-design/web-design.module').then(m => m.WebDesignModule)
},
{
path: 'content',
loadChildren: () => import('./pages/landing/content/content.module').then(m => m.ContentModule)
},
{
path: 'profile',
loadChildren: () => import('./pages/public/freelancer-profile/freelancer-profile.module').then(m => m.FreelancerProfileModule)
},
{
canActivate: [LoginGuardService],
path: 'panel',
loadChildren: () => import('./pages/private/private.module').then(m => m.PrivateModule)
},
{
path: 'freelancer',
loadChildren: () => import('./pages/freelancer-search/freelancer-search.module').then(m => m.FreelancerSearchModule)
},
{
path: '',
loadChildren: () => import('./pages/landing/landing.module').then(m => m.LandingModule)
},
{
path: '',
loadChildren: () => import('./pages/public/public.module').then(m => m.PublicModule)
},
{
path: '',
loadChildren: () => import('./pages/public/logging/logging.module').then(m => m.LoggingModule)
},
{
path: '**',
redirectTo: '404',
}
]; 但是当我进入网络中的content.module /web设计页面时,javascript选项卡、和freelancer-profile也会被加载。

发布于 2021-12-30 02:09:08
问题可能在于,您必须在LoginGuardService内部实现“内容”路径的CanLoad接口。有关更多信息,我将向您提供CanLoad接口文档
https://stackoverflow.com/questions/70108337
复制相似问题