Google Places Autocomplete(ngx-google-places-autocomplete)在Angular 16中不起作用。

huangapple go评论80阅读模式
英文:

Google Places Autocomplete (ngx-google-places-autocomplete) is not working in Angular 16

问题

升级到Angular 16后,“ngx-google-places-autocomplete”不再工作。

出现以下错误

main.ts:29 Unhandled Promise rejection: GooglePlaceModule does not have a module def (ɵmod property) ; Zone: <root> ; Task: Promise.then ; Value: Error: GooglePlaceModule does not have a module def (ɵmod property)

这是集成的代码

  1. @NgModule({
  2. declarations: [...],
  3. imports: [..., GooglePlaceModule],
  4. providers: [...]
  5. exports: [],
  6. bootstrap: [AppComponent],
  7. })
  8. export class AppModule {
  9. constructor() {}
  10. }

有人有解决这个问题的方法吗?

英文:

After upgrading to Angular 16, the "ngx-google-places-autocomplete" does not work any more.

There are the next error

  1. main.ts:29 Unhandled Promise rejection: GooglePlaceModule does not have a module def mod property) ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Error: GooglePlaceModule does not have a module def mod property)

Here is the code of integration

  1. import { GooglePlaceModule } from &#39;ngx-google-places-autocomplete&#39;;
  2. @NgModule({
  3. declarations: [...],
  4. imports: [..., GooglePlaceModule],
  5. providers: [...]
  6. exports: [],
  7. bootstrap: [AppComponent],
  8. })
  9. export class AppModule {
  10. constructor() {}
  11. }

Does someone have a recipe to solve the issue?

答案1

得分: 1

这个包目前不支持 Angular 16 版本。请考虑使用与 ngx-google-places-autocomplete 完全兼容的替代方案。

你可以尝试使用以下链接:
https://www.npmjs.com/package/@angular-magic/ngx-gp-autocomplete

参考链接

英文:

This package is currently not supported for Angular 16 version. Please consider using alternatives that are fully compatible with ngx-google-places-autocomplete

You can try:
https://www.npmjs.com/package/@angular-magic/ngx-gp-autocomplete

Reference

huangapple
  • 本文由 发表于 2023年7月6日 22:16:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76629773.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定