Make two routes with canMatch:
function hasPermissionForA(): boolean {
// whatever
}
export const routes: Routes = [
{
path: 'home',
component: AComponent,
canMatch: [hasPermissionForA]
},
{
path: 'home',
component: BComponent,
canMatch: [hasPermissionForB]
},
{
path: 'home',
component: FallbackComponent,
},
];