把自己当成一个新手。我创建了自己的 Resolver 类并尝试将其注入到我的功能模块中。但这给我带来了以下错误:
core.js:4352 ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(CivilStatusModule)[CivilStatusResolver_Factory -> CivilStatusResolver_Factory -> CivilStatusResolver_Factory -> CivilStatusResolver_Factory]
在功能模块中添加了以下代码:
providers: [CivilStatusResolver]
在 CivilStatusResolver 类中,我添加了如下装饰器:
@Injectable({
providedIn: 'root'
})
export class CivilStatusResolver implements Resolve<boolean> {
constructor(private civilStatusService: CivilStatusService) {}
上述实现中缺少什么?