javascriptangulartypescriptjamstackanalogjs

Rendering routes with 2 or more route parameters with AnalogJS?


I have routes of that are defined like this:

  {
    path: ':category/:topic',
    component: TopicComponent,
    data: ROUTE_DATA,
    resolve: { topic: topicResolver },
    canActivate: [topicGuard]
  },

The AnalogJS documentation explains how to render routes container a single parameter..

So for a single productid parameter we would define a file like this:

products.[productId].page.ts

How do we define routes with 2 or more parameters?

Pseudo code would be something like this:

products.[productId]/[partid].page.ts

Thoughts?


Solution

  • You got to use the dot notation to divide path segments, like this products.[productId].[partid].page.ts.