How to redirect to another page after login in angular?
Try this:
- Put a link to a protected component in the navbar or in some other unprotected component.
- Navigate to the login component by clicking in a link - not by typing the URL in the browser bar. ...
- Now click on the link to the protected component.
- You have been redirected to the login component.
How do I redirect after login?
Simply enter a login URL and logout URL into the 'All Other Users' section. Then, click the 'Save Changes' button. When a new user signs up on your website, WordPress redirects them to the login page. You can set up a redirect URL to send them to any other page on your website.
How to redirect to login page in angularjs?
js you need to specify the new state to redirect to. You need to include $location dependency in your controller and need to call $location. url('/login') to navigate to login page.
How do I redirect in Angularjs?
You can redirect to a new URL in different ways.
- You can use $window which will also refresh the page.
- You can "stay inside" the single page app and use $location in which case you can choose between $location. path(YOUR_URL); or $location. url(YOUR_URL); . So the basic difference between the 2 methods is that $location.