Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何在没有错误的情况下路由有角度的子页面?_Angular - Fatal编程技术网

Angular 如何在没有错误的情况下路由有角度的子页面?

Angular 如何在没有错误的情况下路由有角度的子页面?,angular,Angular,我无法路由有棱角的子页面。 请帮我解决这个问题。我在下面附上了我的路由模块,以了解更多详细信息 它是app.module的子模块 import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { BillingSetupComponent } from './Setup/billing-setup/billing-setup.compo

我无法路由有棱角的子页面。 请帮我解决这个问题。我在下面附上了我的路由模块,以了解更多详细信息

它是app.module的子模块

import { NgModule } from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
     import { BillingSetupComponent } from './Setup/billing-setup/billing-setup.component';
     import { NewBillingMasterComponent } from './Master Billing/new-billing-master/new-billing- 
              master.component';
  import { NewBillingSubMasterComponent } from './Master Billing/new-billing-sub-master/new-billing- 
   sub-master.component';



      export const routes: Routes = [
         {
         path: '', component: BillingSetupComponent,

      children: [

    { path: 'Setup', component: BillingSetupComponent },
    { path: 'Master', component: NewBillingMasterComponent },
    { path: 'SubMaster', component: NewBillingSubMasterComponent },
  
           ]
         }
          ]


         @NgModule({
            imports: [RouterModule.forChild(routes)],
          exports: [RouterModule]
             })



             export class ConfigurationRoutingModule { }

尝试从此行中删除导出导出导出常量routes:routes,并在子级之前添加路径,如我的示例所示


您的配置仅在BillingSetupComponent中有路由器出口时有效。我们无法帮助您找到发布代码的问题。请提供更多代码,或者您可以在此处查看子路由示例:

是的,只有在父级中有路由器出口时,它才能路由子级路由。这可能会有帮助: