我正在开发一个Ionic 2移动应用程序,并且想要使用ngx-translate功能。 在介绍之后,我输入必要的文件在应用模块是这样的:类型'Http'的参数不能分配给离子类型'Http'的参数ngx-translate
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpModule, Http } from '@angular/http';
...
export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
这给错误:
Argument of type 'Http' is not assignable to parameter of type 'Http'.
Property 'handler' is missing in type 'Http'
我认为这是由预计的程序包不匹配NGX,但翻译我无法弄清楚什么和如何。我的@ angular/http版本是4.3.2 有没有人知道该怎么做?
你的建议为我工作。谢谢!!! –
像魅力一样工作,应该被接受为答案。 –
这应该是被接受的答案。工作过,谢谢。 –