I have links as "Register" on login page & "Login" on register page. I used the code below to navigate:
<p>Not a member? <a [routerLink]="['/register']">Register</a></p>
and
<p>Already have an account? <a routerLink="/login">Login</a></p>
Code works perfectly fine if the user is not already logged in. User can navigate to both pages back and forth. But once the user is logged in, and logs out it cannot navigate to Register page anymore (without refreshing the page). The route changes to /register but the page is not loaded.
I have <router-outlet> </router-outlet>
on app.component.html & also tried some other solutions from previous questions but nothing's working so far.