I\'m wondering what the best way is to map the http response from a get request to a class instead of a basic Javascript object.
In my current attempt I simple do
Good practice is to consume data from GET response using
Observable
(regarding to Angular documentation https://angular.io/guide/http) So...
// imports
import {HttpClient} from "@angular/common/http";
// in constructor parameter list
private http: HttpClient
// service method
getHeroes(): Observable {return this.http.get({url}, {options});}
You do not need to do anything more. I consider this approach as most friendly.