Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular9 ivy 报错 #58

Closed
wohugb opened this issue Feb 11, 2020 · 5 comments
Closed

angular9 ivy 报错 #58

wohugb opened this issue Feb 11, 2020 · 5 comments

Comments

@wohugb
Copy link

wohugb commented Feb 11, 2020

NullInjectorError: No provider for InjectionToken NGX_AMAP_CONFIG!

@xieziyu
Copy link
Owner

xieziyu commented Feb 11, 2020

import NgxAmapModule 的时候有用 .forRoot 吗?

@wohugb
Copy link
Author

wohugb commented Feb 11, 2020

用了 NgxAmapModule.forRoot({ apiKey: '**', debug: true }),,不过没在主module里

@wohugb
Copy link
Author

wohugb commented Feb 11, 2020

刚放在 app.module.ts 就可以用了,以前是放在子module里也是可以的

@yangpu
Copy link

yangpu commented Feb 29, 2020

不在app.module里面import,在子模块里面import,lazy loading模式会报错:

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(ReportingModule)[AMapLoaderService -> AMapLoaderService -> InjectionToken NGX_AMAP_CONFIG -> InjectionToken NGX_AMAP_CONFIG -> InjectionToken NGX_AMAP_CONFIG]: NullInjectorError: No provider for InjectionToken NGX_AMAP_CONFIG!

@xieziyu xieziyu mentioned this issue Mar 12, 2020
@xieziyu
Copy link
Owner

xieziyu commented Mar 12, 2020

3.0.3版本已修复此问题,可以在子模块 lazy loading 中使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants