-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
I'm not sure if this is expected behaviour or not, but it seems to me like a bug (in 1.0.0-rc1).
Consider the following state declaration:
$stateProvider.state('verifyEmail', {
parent: 'portal',
url: '/email/verify/:token/:optional',
component: 'verifyEmail',
params: {
token: {
type: 'string',
},
optional: {
value: null,
squash: true,
},
},
});Now what happens is that if I browse to /email/verify it results in a 404, because the route is not found due to the missing token parameter. However, browsing to /email/verify/ with a trailing slash, does load the route and the token parameter is an empty string.
I was under the impression that with the above declaration, the token parameter would in fact be mandatory. If there's nothing behind the trailing slash, then the token parameter should be undefined I think and not load the route, rather than being converted to an empty string.
Now I am still required to check if the token parameter is in fact there in my component, or register a transition event handler, which seems redundant.