Angular now has a command ng generate guard which will create an empty guard. Regardless of that, it is better to put a guard into a dedicated file auth.guard.ts rather than auth.service.ts
Further, RxJS operators are now used inside of pipe(), not by themselves
Angular now has a command
ng generate guard
which will create an empty guard. Regardless of that, it is better to put a guard into a dedicated fileauth.guard.ts
rather thanauth.service.ts
Further, RxJS operators are now used inside of
pipe()
, not by themselves