我正在开发一款Ionic 2移动应用,并希望使用ngx-translate功能.在本教程之后,我将在app模块中导入必要的文件,如下所示:
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');
}
Run Code Online (Sandbox Code Playgroud)
这给出了错误:
Argument of type 'Http' is not assignable to parameter of type 'Http'.
Property 'handler' is missing in type 'Http'
Run Code Online (Sandbox Code Playgroud)
我认为ngx-translate预期的包装不匹配,但我无法弄清楚是什么以及如何.我的@ angular/http版本是4.3.2有谁知道该怎么办?