问题
I'm using Angular 7 and localize router v2.0RC.
I'm facing an issue if the path of my route is like this:
[{
path: 'parentX',
children: [
{
path: 'y/z'
component: AnyComponent
}
]
}]
when I use the changeLanguage
method from LocalizeRouterService
the URL in browser changes but all slashes after parentX
will be url encoded (escaped) and replaced by %2F
which causes not to match any route in the list.
Why is this happening ?
回答1:
The solution I found is to do this:
[{
path: 'parentX',
children: [
{
path: 'y',
children: [
{
path: 'z',
component: AnyComponent
}
]
}
]
}]
来源:https://stackoverflow.com/questions/55696188/in-angular-localize-router-if-path-contains-multiple-slashes-change-language-b