Dear Sir/Madam,
I implemented the AuthGuard. However, I get the following error when it tries to load any Page.
Please help.
Regards,
Partha
The error is as follows:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'canActivate' of undefined
TypeError: Cannot read property 'canActivate' of undefined
at AuthGuard.push../src/app/general/auth-guard.ts.AuthGuard.canActivate (auth-guard.ts:17)
at MapSubscriber.project (router.js:2795)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next (map.js:35)
at MapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54)
at Observable._subscribe (subscribeToArray.js:5)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe (Observable.js:42)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe (Observable.js:28)
at MapOperator.push../node_modules/rxjs/_esm5/internal/operators/map.js.MapOperator.call (map.js:18)
at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe (Observable.js:23)
at MergeMapOperator.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapOperator.call (mergeMap.js:28)
at AuthGuard.push../src/app/general/auth-guard.ts.AuthGuard.canActivate (auth-guard.ts:17)
at MapSubscriber.project (router.js:2795)
at
app-routing.module.ts
auth-guards.ts