dashboard.service.tsUnbehandelte Versprechen Ablehnung: Kein Provider für AuthHttp! ; Zone: Winkel in angular2-jwt
import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { AuthHttp } from 'angular2-jwt';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
constructor (private http: Http,private authHttp: AuthHttp) {}
Wenn ich dies tun gibt es einen Fehler Error: Uncaught (in promise): Error: DI
app.module.ts
import { HttpModule } from '@angular/http';
import { AuthModule } from 'angular2-jwt';
.
imports: [
HttpModule,
AuthModule
],
Wie ich dieses Problem lösen ?
Haben Sie die Httpmodule in Ihrem ngmodule importiert? Haben Sie AuthHttp als Provider in Ihrem ngModule festgelegt? :) – Alex
nein .............. –
Ich aktualisiere meine Frage und füge app.module.ts –