I\'m currently switching to the new HttpClient of Angular 4.3. One advantage is that I can specify a type info on the GET method and that the returned JSON is parsed into th
Similar to Jonas Stensved's answer, but using pipes:
import { map } from "rxjs/operators";
this.http.get(url)
.pipe(
map(response => {
response.mydate = new Date(response.mydate);
return response;
})
Note the different import syntax of the map
operator.
Pipes were introduced in RxJS 5.5. They facilitate import handling, code readability, and reduce bundle size. See Understanding Operator Imports.