Middle wildcard selector in Angular 2 router

I am trying to develop a project using Angular.js 2. I am trying to use a router.

I am trying to create a route with parameters to catch things like the following:

/m/SOMETHING1/c/SOME/THING2/p/SOMETHING3

Please note that SOME / THING2 is a string that may contain 0 or more / in it

What do I need to determine the route: { path: "/m/:sth1Var/c/*sth2Var/p/:sth3Var", component: MultiPost, name: "RouteName" }

But I could not find a way to use a wildcard (*) in the middle.

Is it possible that I'm trying to achieve without capturing the whole URL and parsing the whole thing myself?

+4
source share
1 answer

, . .

0

Source: https://habr.com/ru/post/1623339/


All Articles