Since the latest Angular2 version (2.0.0-beta.14) it is possible to have query parameters that contain multiple slashes, like /foo/bar.
This works great, however whenever I use a parameter with multiple slashes within a RouterLink link, it escapes the /
with %2F
causing the routes to not work anymore on reload.
My link looks like this: <a [routerLink]="['/Page', {page: page.url | slug}]" class="list-group-item">{{ page.title }}</a>
Inside of the 'slug' pipe I even URIDecode
the string, and when I log it it is correct. It would log something like /pages/level-1/
, but when I inspect the actual a
tag on the page it says href="/pages%2Flevel-1"
.
I'm pretty clueless, because even when I print the value of {{ page.url | slug }}
within my HTML template, it returns the url with slashes.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…