I have created a login page using Angular 7. I have created how the login page looks in the initial app.component.html file and I implemented the logic at app.component.ts file.
I also put a link "Forgot password". I put a router link redirecting to the forgot-password.component.html. The url changes correctly (from localhost:4200 to localhost:4200/forgot-password) but the forgot-password.component.html is drawn on top of the previous login page.
How can I erase the login page and go to the forgot password page?
loginandforgot passwordseparate component. add<routeroutlet></routeroutlet>in your appComponent. can you create smallhttps://stackblitz.comfor your problem.