Route parameter with slash (URLs)


is there an easy way to do something like:

routes: [

  path: '/link/:url',
  ... get the $url with slash?


I understand why this is not working as an url has also slashes and therefore the router does not parse it correctly. Usually I would encode the url string somehow to deal with it, but it is a bit tricky in this case. I was wondering if there is another way to pass urls as a parameter. Something to tell the router that the given parameter does include slashes. This needs to be the only or last parameter of course to prevent further parsing

No chances, you need to encodeURIComponent and decodeURIComponent or pass it as query, e.g. /link/?url=...

1 Like

Thx! query parameter is the solution in my case… great!

1 Like