$state.href returns incorrect URL with custom type object
I have a route with custom type applied on it
$stateProvider.state('root.projects', {
url: "projects/{filterPath:nonURIEncoded}",
params: {
filterPath: {
value: null,
squash: true
}
}
})
The purpose of the custom type "nonURIEncoded" is to treat the trailing slashes in state parameter as the valid url parameter
Below code gives me incorrect output
$state.href("root.projects", {
filterPath: "computer-engineering/"
}, {
absolute: true
});
Expected Output: http://localhost/projects/mechanical-engineering/ Output i am getting: http://localhost/projects/electronics-engineering%2F
It seems state.href encodes the URL parameters and doesn't apply custom type object given to particular ui-state param.
Yeah its an ongoing issue. There are a few tickets open already that is similar to this. For now, can you just not use the /?
Well, I needed a generic solution for the issue, above given example is just one of the scenario, I am looking for a solution in which i get a URL having custom type applied to it if applicable.