I'm trying to generate a custom access denied page by redirecting to a new component. But it still goes to access denied path and says page not found 404. Any suggestions?
I tried to redirect to a new component when an unknown path is found assuming it as access denied path.
{ path: 'accessDenied', component: AccessDeniedComponent },
{ path: '**', redirectTo: '/accessDenied' }
I expect to load AccessDeniedComponent, but it shows page not found recognizing as the path doesn't exist.