I am currently working on an Angular application where the user experience varies based on the user's role. The user can either be a customer or an admin.
Within my routing module, I have set up the following routes:
{path: '', redirectTo: 'admin-portal', pathMatch: 'full'},
{path: 'admin-portal', component: AdminPortalComponent, canActivate: [AuthGuard]},
{path: 'customer-portal', component: CustomerPortalComponent, canActivate: [AuthGuard]}
My goal is to fetch a variable from local storage upon app load and use it to determine where to redirect the user. I am considering implementing a condition like
{path: '', redirectTo: 1===1 ? 'admin-portal' : 'customer-portal', pathMatch: 'full'}