exhtml
7/6/2018 - 6:08 AM

(delete-me) httpclient get

getWriterWithFavBooks(): Observable<any> {
  return this.http.get(this.writerUrl, {responseType: 'json'});
} //if response type is JSON then using responseType: 'json' is optional  

Now in our component subscribe to instance of Observable for actual hit of request to server and get response.

getWriterWithFavBooks() {
  this.writerService.getWriterWithFavBooks().subscribe(
      data => { 
	      this.favBooks = data['books'];
	  }
  );
}