is there a equivalent to this "res.json().data" in new HttpClient in angular 5 I'm currently using? Because my api gives me back this kind of json object?
{"data":[{"something":1,"somethingelse":"62968D6B-B50E-4C46-BDB7-8152E3DFB8AC","somethingsomething":null}]}
And previously I've been able to extract data using .data, but no longer can do that, help :(
//in my service
getUsers() {
return this._http.get(url)
.map(res => res.json().data)
.catch(this._errorHandler);
}
//in my component.ts
this.service.getUsers().subscribe(users => {
this.users = users;
UPDATE In my component
this._usermanagementservice.getEmployees().subscribe((data) => {
this.employeelist = data; });
And in the service getEmployees() {
return this._http.get<employee[]>('url')
.map(res => res.data)
}