String turned to Object when passed from client to nodeJS

Viewed 72

I'm using yeoman angular-fullstack to generate my project. So the client is angularJs (typeScript) and the backend is nodeJs. The problem is I got a variable and when I print it to the console, I get a very long string, (if u need to know its a photo_reference from googleplacesapi). And when I pass it to the with a http.get to the nodeJS api, and print it to the log I get the response Object object.

MainController

    for (var photo of response.data.result.photos) {
      this.getImages(photo);
      console.log(photo.photo_reference);
    }
  getImages(photo_reference: string): void{
    this.$http.get('/api/image/' + photo_reference).then((response) => {

    });
  }

NodeJs

export function show(req, res) {

    console.log("photoreference:" + req.params.photoreference);
2 Answers
Related