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 guardwhich will create an empty guard. Regardless of that, it is better to put a guard into a dedicated fileauth.guard.tsrather thanauth.service.tsFurther, RxJS operators are now used inside of
pipe(), not by themselves