1

我已经Ionic 3使用 .It 完成了应用程序的国际化ngx-translate。它给了我以下错误。

我已经使用官方文档here做到了。

找不到模块'@angular/common/http'

在此处输入图像描述

4

2 回答 2

1

问题@angular/common/http仅在angular 4.3+. 但Ionic 3我们正在使用Angular 4.1.3.

所以这是解决方案:

我已删除 @ngx-translate/http-loader

npm 卸载 @ngx-translate/http-loader --save

添加它的旧版本:

npm i @ngx-translate/http-loader@0.1.0 --save

你可以在 Git 上阅读更多关于它的信息

于 2017-09-06T14:13:31.533 回答
0

HttpClientAngular 4.3.0中引入,您使用的是 4.1.3。

在您使用的 Angular 版本中,您可以注入Http(需要HttpModulein imports: [...]of AppModule),但它具有不同的功能和不同的 API。

于 2017-09-06T14:13:40.407 回答