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

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

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)

这是集成的代码


@NgModule({
  declarations: [...],
  imports: [..., GooglePlaceModule],
  providers: [...]
  exports: [],
  bootstrap: [AppComponent],
})
export class AppModule {
  constructor() {}
}

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

英文:

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

There are the next error

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

import { GooglePlaceModule } from &#39;ngx-google-places-autocomplete&#39;;

@NgModule({
  declarations: [...],
  imports: [..., GooglePlaceModule],
  providers: [...]
  exports: [],
  bootstrap: [AppComponent],
})
export class AppModule {
  constructor() {}
}

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:

确定