1
나는 다음과 같은 한 오류 유형의 매개 변수에 할당 할 수없는 :인수는 'HTTP를'
[ts] Argument of type 'Http' is not assignable to parameter of type 'Http'. Property '_backend' is protected but type 'Http' is not a class derived from 'Http'. (parameter) http: Http
이 오류는 파일 auth.module.ts에
import { NgModule } from '@angular/core';
import { Http, RequestOptions } from '@angular/http';
import { AuthHttp, AuthConfig } from 'angular2-jwt'
import { AuthService } from './auth.service';
import { AuthGuard } from './auth.guard';
import { RoleGuard } from './role.guard';
import { GuestGuard } from './guest.guard';
export function authHttpServiceFactory(http: Http, options: RequestOptions) {
return new AuthHttp(new AuthConfig(), http, options);
}
@NgModule({
providers: [
AuthService,
AuthGuard,
RoleGuard,
GuestGuard,
{
provide: AuthHttp,
useFactory: authHttpServiceFactory,
deps: [Http, RequestOptions]
}
]
})
export class AuthModule {}
무엇 인 잘못된?
어떤 각도의 angular2-jwt 버전을 사용하고 있습니까? – jgranstrom
"angular2-jwt": "^ 0.2.0"package.json https://pastebin.com/gYiqMV5m – Defus
코드에 명백한 오류가 보이지 않지만 각도 모듈의 버전을 볼 수 없습니다. 당신이 게시 한 package.json에서. 당신의 각진 모듈은'2.4.2 '이전 버전입니까? – jgranstrom