Angular 2+不会更改页面更改时的布局

时间:2018-04-16 11:24:28

标签: angular routing routes angular5

这是我的路线:

const routes: Routes = [
{
path: 'authorization',
component: AuthorizationLayoutComponent,
children: [
  {
    path: 'login',
    component: AuthorizationLoginComponent
  },
  {
    path: 'advertiser',
    canActivate: [AuthorizationGuard],
    children: [
      {
        path: 'new-campaign',
        component: AdvertiserNewCampaignComponent
      }
    ]
  }
]
},
{
path: 'advertiser',
canActivate: [AuthorizationGuard],
component: HomeLayoutComponent,
children: [
  {
    path: 'dashboard',
    component: AdvertiserDashboardComponent,
  },
}

目前,用户位于以下页面:/ advertiser / dashboard。他想要转到页面/授权/广告客户/新广告系列。因此,他点击了与routerLink =“/ authorization / advertiser / new-campaign”的链接,并成功将他移至此页面。但由于某些原因,布局AuthorizationLayoutComponent不加载,只有页面本身。为什么呢?

0 个答案:

没有答案