getData(id : number) : Observable<Post> {
    return this.http.get(
${this.requestUrl}/${id}
)       .map(this.mapResponse)       .catch(this.handleError)   }   mapResponse(response : Response) : Post {     return response.json();   }
The map() function takes in a lambda function or a reference to a function that will execute the procedure and return the mapped result.
Accepts (res : Respone) and returns a result.
Comments