我已经Ionic 3
使用 .It 完成了应用程序的国际化ngx-translate
。它给了我以下错误。
我已经使用官方文档here做到了。
找不到模块'@angular/common/http'
问题@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 上阅读更多关于它的信息
HttpClient
在Angular 4.3.0中引入,您使用的是 4.1.3。
在您使用的 Angular 版本中,您可以注入Http
(需要HttpModule
in imports: [...]
of AppModule
),但它具有不同的功能和不同的 API。