AlexKhymenko / ngx-permissions

Permission and roles based access control for your angular(angular 2,4,5,6,7,9+) applications(AOT, lazy modules compatible
MIT License
936 stars 126 forks source link

routeStateSnapshot in redirect is undefined #219

Closed InbarTakdim closed 1 year ago

InbarTakdim commented 1 year ago
    what can be the reason of  routeStateSnapshot is undefined it the funstion of redirect?

permissions: { only: [Roles.LOCATION_ENERGY, Roles.LOCATION_MAP], redirectTo: { LOCATION_ENERGY: ( rejectedPermissionName: string, activateRouteSnapshot: ActivatedRouteSnapshot, routeStateSnapshot: RouterStateSnapshot ): string => { return ${routeStateSnapshot?.url}/1; }, LOCATION_MAP: ( rejectedPermissionName: string, activateRouteSnapshot: ActivatedRouteSnapshot, routeStateSnapshot: RouterStateSnapshot ): string => { return ${routeStateSnapshot?.url}/2; } } }

AlexKhymenko commented 1 year ago

I'm sorry ite better to ask on stackoverflow or chatGpt. The problem is with overrall solution not with library