I am analyzing how to start a project with Angular.
In a previous one, which we currently have running, assembled with AngularJS 1.5, with a structure similar to the one I'm looking for, which is a login screen, which, if the user exists, takes you to a website.
This was structured with an abstract template, which has 2 children, one for the login and the other for the menu template, which is used throughout the internal structure of the web.
I have the doubt that in Angular 4 the project should not be structured like this. Can you give me a hand on how to set up this structure?
Given the fact that you use the router in your Angular 2+ project, you can choose to have your authentication component and your other intranet components routed and so from a third component, for example app-component have there the
<router-outlet>
angular one that controls what to show.Here the important thing is to have Guards , which are nothing more than the interceptors or middlewares of the angular routes. This is where you decide if the dashboard can be seen only if the user is authenticated.
update
An example of a Guard