title: How to make a synchronous call in angular 5?
body: <p>So, I was trying to get the solution of this problem. But, somehow I am unable to do so, May be because of the lack of knowledge in angular 5.
  This is my service:</p>
  
  <pre><code>GetCurrentUserData(): Observable&lt;ResponseData&gt; {
      return this.http.get&lt;ResponseData&gt;(ApplicationURLS.GetCurrentUserInformation)
          .map(response =&gt; {
              return response;
          });
      //.catch(error =&gt; this.handleError(error));
  }
  </code></pre>
  
  <p>This is my component:</p>
  
  <pre><code>public GetCurrentUserInformation(): any {
  
          return this.loginService.GetCurrentUserData().subscribe(data =&gt; { return data; });
      }
  </code></pre>
  
  <p>Here I am trying to access the data:</p>
  
  <pre><code>ngAfterViewInit() {
          debugger;                
          this.responseData = this.GetCurrentUserInformation();
          if (this.responseData.code != responseCodes.success) {
              this.googleInit();
          }
  
      }
  </code></pre>
  
  <p>When I check the this.responseData it is always returning this instead I want data:
  <a href="https://i.stack.imgur.com/704lX.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/704lX.jpg" alt="enter image description here"></a></p>
  
  <p>I just want to make a sync call so I can get the data immediately.  </p>
  
  <p>I also tried to use the do() in service but its returning do() is not a function.</p>