Вы должны попробовать adal-angular5 out
В app.module.ts
import { HttpClient, HttpClientModule } from '@angular/common/http';
...
imports: [..., HttpClientModule ], // important! HttpClientModule replaces HttpModule
providers: [
Adal5Service,
{ provide: Adal5HTTPService, useFactory: Adal5HTTPService.factory, deps: [HttpClient, Adal5Service] } // // important! HttpClient replaces Http
]
Пример
import { Adal5HTTPService, Adal5Service } from 'adal-angular5';
...
export class HttpService {
constructor(
private adal5HttpService: Adal5HTTPService,
private adal5Service: Adal5Service) { }
public get(url: string): Observable<any> {
const options = this.prepareOptions();
return this.adal5HttpService.get(url, options)
}
private prepareOptions():any{
let headers = new HttpHeaders();
headers = headers
.set('Content-Type', 'application/json')
.set('Authorization', `Bearer ${this.adal5Service.userInfo.token}`);
return { headers };
}