Angular imported library with forRoot throwing error [closed]

I fixed it; I was following this article:

If you notice it does declares this constant:

import { InjectionToken } from '@angular/core';
import { NormalLibConfig } from './normal-lib-config';

export const NORMAL_LIB_CONFIG = new InjectionToken(

What I noticed was that even though it imports NormalLibConfig, it never actually uses it. So I googled InjectionToken and found that it’s a generic class. So I updated my implementation to this:

import { InjectionToken } from '@angular/core';
import { ImagesConfig } from './images-config';

export const IMAGES_CONFIG = new InjectionToken<ImagesConfig>('IMAGES_CONFIG');

And that fixed the issue

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top