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

后端 未结 12 2195
陌清茗
陌清茗 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:36

    Try to add

    @Injectable({ providedIn: 'root' }) no need to add to module provider.

提交回复
热议问题