以角度2在另一个子组件下路由

时间:2017-01-02 11:25:47

标签: angular angular2-routing

我一直试图在一个子组件下进行路由,但它并没有按照我想要的方式运行。以下是代码;我想在Notes组件下路由。我创建了一个名为GradedComponentList的路由列表,但仍然无法在Notes组件下进行路由。

//仪表板路线

export const AdminRoutes: Routes =[

  {
    path: 'dashboard',

    component: AdminComponent,
    children: [
      {path: '', redirectTo: 'consumer'},
      {path: 'login', component: LoginFormComponent},
      {path: 'task', component: RegisterFormComponent},
      {path: 'leads', component: DeleteFormList},
      {path: 'customer', component: NotesComponent,
        children: [...GradeComponentList]
      }
    ]
  }

// GradedComponentList

    import {GradedComponent} from '../Client/add_customer';


    export const GradedRouting : Routes = [
      {
        path: 'Graded',
        component: 'GradedComponent',
        children:[
          {path: 'add_grade', component: GradedComponent},
        ]
      }
    ];

//Dashboard 


<div class="collapse navbar-collapse navbar-ex1-collapse">
      <ul id="active" class="nav navbar-nav side-nav">
        <li class="active"><a routerLink="login"><i class="fa fa-dashboard"></i> Dashboard</a></li>
        <li class=""><a routerLink="customer"><i class="fa fa-tasks"></i>  Customer</a></li>
        <li class=""><a routerLink="leads"><i class="fa fa-database"></i>  Leads</a></li>
        <li><a routerLink="task"><i class="fa fa-users"></i>Teams</a></li>

<div id="page-wrapper">
  <div>
    <router-outlet ></router-outlet>


  </div>

1 个答案:

答案 0 :(得分:0)

这应该做你想要的事情

subplot(1,3,1)
plot(...)

<a routerLink="/customer/Graded/add_grade">