How to match route only if param is integer in Angular2?

Discussão em 'Angular' iniciado por RNR, Novembro 15, 2024.

  1. RNR

    RNR Guest

    For example this router

    {
    path: '/client',
    component: ClientRootComponent,
    children: [
    {path: '', component: ClientListComponent},
    {path: ':clientId', component: ClientOpenComponent, resolve: makeResolver(ClientOpenResolver)}
    ]
    },
    {
    path: '**',
    component: NotFoundComponent
    }


    will pass both URLs /client/1234 and /client/asdf to ClientOpenComponent. How I can make that /client/asdf will be matched as NotFound and passed to NotFoundComponent?

    Continue reading...

Compartilhe esta Página