Let say I go to /unknown-route?a=hello&b=world
and $routeProvider
doesnt recognize it and redirect to the otherwise route:
otherwise({
redirectTo: '/default-route'
});
Is it possible to pass the given parameters to the redirected route.
Here it would be /default-route?a=hello&b=world
I found a working solution:
otherwise({
redirectTo: function() {
return '/default-route' + location.search;
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With