I have an Angular 2 application. A service is requests data from an api that returns the results like the following:
{ \"data\":[ {\"id\":1,\"ti
I would map the string field to a date one:
getList() : Observable { return this._http.get(this._getListUrl).map(this.extractData); } private extractData(res: Response) { var data = res.json().data || []; data.forEach((d) => { d.timestamp = new Date(d.timestamp); }); return data; }