“No provider for AuthGuard!” using CanActivate in Angular 2

后端 未结 12 2076
陌清茗
陌清茗 2021-02-03 20:09

EDIT : Obviously this is outdated, now you provide your guard at the providers array in an NgModule. Watch other answers or official documentation

12条回答
  •  孤城傲影
    2021-02-03 20:52

    Actually, it was only a typo in an import...

    I was typing

    import { AuthGuard } from './../Authentification/auth.guard';

    instead of

    import { AuthGuard } from './../authentification/auth.guard';

    making it not working but at the same time not displaying me any error...

    (sadface)

提交回复
热议问题