diff --git a/src/app/crm/lead/lead.service.ts b/src/app/crm/lead/lead.service.ts index 3494a6e..60006ae 100644 --- a/src/app/crm/lead/lead.service.ts +++ b/src/app/crm/lead/lead.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Http } from '@angular/http'; +import { HttpClient } from '@angular/common/http'; import { environment } from '../../../environments/environment'; import 'rxjs/add/operator/toPromise'; @@ -8,11 +8,11 @@ export class LeadService { private apiUrl = environment.crmApi; - constructor(private _http: Http) { + constructor(private _http: HttpClient) { } getLead() { const url = `${this.apiUrl}/contacts.json`; - return this._http.get(url).toPromise().then(res => res.json()); + return this._http.get(url).toPromise(); } }