Skip to content

Commit 6cb42bc

Browse files
committed
fix: http -> httpClient
1 parent f0feadb commit 6cb42bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/crm/lead/lead.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable } from '@angular/core';
2-
import { Http } from '@angular/http';
2+
import { HttpClient } from '@angular/common/http';
33
import { environment } from '../../../environments/environment';
44
import 'rxjs/add/operator/toPromise';
55

@@ -8,11 +8,11 @@ export class LeadService {
88

99
private apiUrl = environment.crmApi;
1010

11-
constructor(private _http: Http) {
11+
constructor(private _http: HttpClient) {
1212
}
1313

1414
getLead() {
1515
const url = `${this.apiUrl}/contacts.json`;
16-
return this._http.get(url).toPromise().then(res => res.json());
16+
return this._http.get(url).toPromise();
1717
}
1818
}

0 commit comments

Comments
 (0)