英文:
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: <root> ; Task: Promise.then ; Value: Error: GooglePlaceModule does not have a module def (ɵmod property)
Here is the code of integration
import { GooglePlaceModule } from 'ngx-google-places-autocomplete';
@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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论