I recently embarked on building an Angular2+ App after just beginning to learn Angular a week ago.
Here is my planned structure: - index.html - AppComponent (app-root) - Header Component (header) - Signup Component (signup)
The SignupComponent will function as a modal.
Upon successful login, I aim to replace the Signup Account with the User Component, which will be a drop-down menu containing multiple links (such as Account and Logout).
My proposed solution involves emitting an event from the Signup Component to the Header component upon successful login.
In response to this event, the Header component will transition to the User Component, hiding the Signup Component Div in the process.
The User Component should include an Auth Guard to protect the links within the drop-down menu.
I have a couple of questions:
How do I route from the Signup Modal back to index.html with the necessary changes? Do I need to refresh index.html to load the account component? How can I navigate to index.html so that it displays the new User Component instead of the signup component?
Is this approach correct? If not, what would be the optimal way to accomplish this in Angular 2+?