I know I can use Role / auth based routing and I can activate and deactivate it at the routing module.
I also want to hide the options Guard based.
I have an [AuthGuard] and a [RoleGuard] both implement canLoad(), canActivate() etc and is assigned to the corresponding property at the routing.
Now I was wondering if i can do the same with the links which are nav option I made as an array
options: MenuItem[] = [
{
page: "Active Devices",
icon: "tablet",
path: "device-status",
canLoad:[AuthGuard]
}, {
page: "Data Sync",
icon: "refresh",
path: "data-sync",
canLoad: [AuthGuard]
}, {
page: "Add Users",
icon: "user",
path: "add-users",
canLoad: [AuthGuard]
}, {
page: "Change Password",
icon: "key",
path: "change-password",
canLoad: [AuthGuard]
}]
I was wondering how to make the canLoad() function in AuthGuard get value assigned to canLoad() of this array.