I do an Angular app using Angular7, and i try to use two "router-outlet" tag, For example I have two components "main" and "main2", that are halfly the same, they are routed in a parent component, and I want to route their differences in two 'children component, is it possible ? have you any way to explore ? Thanks ;)
Is it possible to use two routes in angular?
251 Views Asked by iti At
2
There are 2 best solutions below
0

For those who has the same problem as me, I use a "main" component and a "auth" component. The "main" component contain the "router-outlet" tag and my "auth" component contain my login view. In my app.componnt.html, I just use
<app-auth *ngIf="!isAuth"></app-auth>
<app-main *ngIf="isAuth"></app-main>
With that method, any user who want to access to a particulary path will not be redirect to an auth view and will keep the path he want to access.
Well, if I understand your questions very well. It is very possible as a case where you have login and dashboard, for instance
With every component imported and correct path referencing