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
http://example.com/#/login?ref=/path
It should be
$location.path('/login').search('ref', '/path/to/redirect')