首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >负载角模块在另一条路径上加载

负载角模块在另一条路径上加载
EN

Stack Overflow用户
提问于 2021-11-25 09:02:24
回答 1查看 26关注 0票数 0

我正在使用角度负载来装载我的模块,下面是我的路线:

代码语言:javascript
复制
  {
    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也会被加载。

EN

回答 1

Stack Overflow用户

发布于 2021-12-30 02:09:08

问题可能在于,您必须在LoginGuardService内部实现“内容”路径的CanLoad接口。有关更多信息,我将向您提供CanLoad接口文档

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70108337

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档