I want to redirect user to another page after successful login using query string. If I copy & paste to browser's address bar http://example.com/#/login?ref=/path/to/redirect
it works fine. But if I use
$location.path("/login?ref=/path/to/redirect");
url looks like
http://example.com/#/login%3Fref=/path/to/redirect
How can I decode %3F to '?' ? Thanks
To pass in parameter values, simply append them to the query string at the end of the base URL. In the above example, the view parameter script name is viewParameter1.
1. absUrl() Method: It returns the full path of your page and it is a read-only method. HTML.
It should be
$location.path('/login').search('ref', '/path/to/redirect')
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