简体   繁体   中英

route changes address but doesn't do anything

Here are my routes.

export const routes: Routes = [
  { path: 'signin-callback', component: SigninCallbackComponent },
  {
    path: '',
    component: DatasetListComponent,
    children: [
      {
        path: 'login',
        component: LoginComponent
      },
      {
        path: 'datasets',
        component: DatasetListComponent
      },
      {
        path: 'dataset/:datasetId',
        component: DatasetComponent
      }
    ]
  },
];

At /datasets the page loads and loads the list of datasets as expected.

A link

<a class="btn btn-primary" [routerLink]="['dataset', d.DatasetId]">

Updated the browser address -- complete with the id , but nothing happens.

What's going on?

The problem is children . Moving the route objects to be siblings of the parent level makes it work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM