如何解决ngx-cookies同意抛出错误通用类型'ModuleWithProviders <T>'需要1个类型参数
我正在使用Angular 10,并尝试使用ngx-cookiesconsent软件包。我从ngx-cookieconsent收到错误消息:
ERROR in node_modules/ngx-cookieconsent/cookieconsent.module.d.ts:7:53 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).
static forRoot(config: NgcCookieConsentConfig): ModuleWithProviders;
我相信我已经正确地将它连接到了app.module.ts文件中,如下所示:
imports: [
NgcCookieConsentModule.forRoot(cookieConfig),BrowserModule,AppRoutingModule,BrowserAnimationsModule,LayoutModule,MaterialModule,HttpClientModule,AccountModule
],
ngx-cookieconsent确实正确声明了该方法(在版本2.2.3中),如https://github.com/tinesoft/ngx-cookieconsent/blob/master/src/cookieconsent.module.ts所示。
我做错什么了吗?
解决方法
我知道了。我的angular.json文件中没有正确的路径。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。