We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0feadb commit 6cb42bcCopy full SHA for 6cb42bc
src/app/crm/lead/lead.service.ts
@@ -1,5 +1,5 @@
1
import { Injectable } from '@angular/core';
2
-import { Http } from '@angular/http';
+import { HttpClient } from '@angular/common/http';
3
import { environment } from '../../../environments/environment';
4
import 'rxjs/add/operator/toPromise';
5
@@ -8,11 +8,11 @@ export class LeadService {
8
9
private apiUrl = environment.crmApi;
10
11
- constructor(private _http: Http) {
+ constructor(private _http: HttpClient) {
12
}
13
14
getLead() {
15
const url = `${this.apiUrl}/contacts.json`;
16
- return this._http.get(url).toPromise().then(res => res.json());
+ return this._http.get(url).toPromise();
17
18
0 commit comments