0

Consider myself as a newbie. I have created my own Resolver class and trying to inject it in my feature module. But it is throwing me following error:

core.js:4352 ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(CivilStatusModule)[CivilStatusResolver_Factory -> CivilStatusResolver_Factory -> CivilStatusResolver_Factory -> CivilStatusResolver_Factory]

Added following code in feature module:

providers: [CivilStatusResolver]

And in the CivilStatusResolver class I have added Decorator as below:

@Injectable({
  providedIn: 'root'
})
export class CivilStatusResolver implements Resolve<boolean> {
  constructor(private civilStatusService: CivilStatusService) {}

What is the missing part in the above implementation?

Muhammad zubair
  • 106
  • 1
  • 7

1 Answers1

0

The resolver is supposed to be in the Feature Module right ?
So instead of providing providedIn: 'root' try giving providedIn: FeatureModule and remove CivilStatusResolver from providers array or vice versa.

Abdu Manas C A
  • 1,089
  • 1
  • 11
  • 19