Can I use es6 Map type in a HTTP Response DTO?
For instance Angular 2 request:
public loadFoos(): Observable<FoosWrapper> {
return this.http.get("/api/foo")
.map(res => res.json());
}
And a DTO
export class FoosWrapper{
foos: Map<string, Foo[]>;
}
After res.json() I am receiving simple object instead of Map.
I know I have to convert data myself into the Map, but what is the best approach for this? Iterating over the properties?