EXCEPTION:未捕获(承诺):错误:无法匹配任何路由。网址细分:'信息中心'

时间:2017-02-02 12:07:44

标签: angular routing

在我使DetailsComponent成为LocationComponent的子项后,我得到错误" EXCEPTION:Uncaught(在promise中):错误:无法匹配任何路由。网址细分:'信息中心'"当我从我的应用程序进行默认登录时。可能是什么错误?

//的login.html

  <button class="button" routerLink="/dashboard"><span>Login </span></button>

//路线

export const DashboardRoutes: Routes =[

  {
    path: 'dashboard',

    component: DashboardComponent,
    children: [
      {path: '', redirectTo: 'location'},
      {path: 'game', component: GameComponent},

        {path: 'location', component: LocationComponent, children: [


            {path : '/details', component: DetailsComponent},


        ]



  },

1 个答案:

答案 0 :(得分:0)

export const DashboardRoutes: Routes =[
  {
    path: 'dashboard',
    component: DashboardComponent,
    children: [
      {path: '', redirectTo: 'location'},
      {path: 'game', component: GameComponent},
        {path: 'location', component: LocationComponent, children: [
            {path: '', redirectTo: 'details'},
            {path : 'details', component: DetailsComponent}
        ]
  },