import {
RoleGuard
} from '../guards/role-guard.service';
// [...]
children:
{
path: 'admin',
component: AdminComponent,
canActivate: [RoleGuard],
**
data: {
role: 'Admin'
} **
},
I don't want to hard-code role string,i want to fetch roles from role service then pass dynamically routes in Route Module.
Is there any way to call service in routing Module.