尝试创建一个多语言应用程序,httpclient问题

时间:2018-05-16 16:07:23

标签: angularjs ngx-translate

您好我尝试了this tutorial,当我添加此

import {HttpClientModule, HttpClient } from '@angular/common/http';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';

export function HttpLoaderFactory(http: HttpClient ) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

我收到此类错误

Argument of type 'HttpClient' is not assignable to parameter of type 'Http'. Property '_backend' is missing in type 'HttpClient'. 

我该怎么做才能解决此错误

0 个答案:

没有答案