title: Infinite HTTP requests to the back-end when subscribing to an observable
body: <p>I'm adding a feature to an Angular2 site to display the currently logged-in user's name.  </p>
  
  <p>I seem to be able to retrieve the information I need from the back-end service.  However, when the front-end code in question is running, requests to the back-end are being sent repeatedly and as fast as possible when only one request is needed.</p>
  
  <p>This infinite loop of requests started when I changed the code to subscribe to an observable.  Without subscribing, the information I was able to retrieve from the front-end service was not usable; it looked like the example below.</p>
  
  <pre><code>{"_isScalar":false,"source":{"_isScalar":false},"operator":{}}
  </code></pre>
  
  <p><strong>Component</strong></p>
  
  <pre><code>loggedInUser() {
      this.authService.loggedInUser().subscribe(res =&gt; {
        this.currentUser = res;
        return this.currentUser;
     })
  }
  </code></pre>
  
  <p><strong>Front-End Service</strong></p>
  
  <pre><code>loggedInUser() {
      const userId = localStorage.getItem('userId');
      return this.http
         .get('http://localhost:3000/user/current/' + userId)
         .map((response: Response) =&gt; {
      const user = response.json();
    return user;
  })
  </code></pre>
  
  <p>I learned that this isn't truly an "infinite loop" from reading other posts on Stack Overflow.  I wasn't able to comprehend the solutions in those other posts, however.</p>
  
  <p>Thank you for your help!</p>