I am building an Angular2+ App. Started learning angular 1 week back.
Following is the structure -index.html - AppComponent(app-root) - Header Component(header) - Signup Component(signup)
SignupComponent is a Modal.
After a successful login, I want to replace my Signup Account with User Component(which should be drop down menu with multiple links - (Account link, Logout link) ).
The solution which I thought was that on a successful login, I should emit the event to Header component from Signup Component.
On receiving the event , Header component should switch to UserComponent and hide the Signup Component Div.
User Component should have a Auth Gaurd because the links in drop down should be protected.
I have few questions
How should I route from Signup Modal to index.html with changes needed? - Do I need to refresh the index.html where it will load the account component? How should I route to index.html which should have the new User component in place of signup component. ?
Is this a right approach? If not,what is the ideal way to do this in angular 2+?