title: Can't return response from httpclient post function to other custom function in angular 4
body: <p>I have <code>addUser(newUser)</code> function in sign-in.service.ts file as follows</p>
  
  <pre><code>addUser(newUser)
    {
      const httpOptions = {
        headers: new HttpHeaders({ 'Content-Type': 'application/json' })
      };
      let body = JSON.stringify(newUser);
      this.httpclient.post('http://localhost:3000/api/signup', body, httpOptions).subscribe(res=&gt;{
        console.log(res);
        return res;
      });
    }
  </code></pre>
  
  <p>Here console's output is <code>{msg: "succesfully added", status: 200}</code>
  but when i m calling the above <code>addUser(newUser)</code> function from sign-in.component.ts file as follows</p>
  
  <pre><code>  addUser()
    {
      console.log(this.first_name,this.last_name,this.userName,this.email);
      let newUser = {
        "first_name":this.first_name,
        "last_name":this.last_name,
        "username":this.userName,
        "email":this.email
      }
      console.log(this.signService.addUser(newUser));
    }
  </code></pre>
  
  <p>console output is showing <code>undefined</code> . Why? Please help me. Thank you.</p>