title: Http request made multiple times in Angular2 service
body: <p>I have created a service that makes a simple GET request:</p>
  
  <pre><code>private accountObservable = null;
  
  constructor(private _http: Http) {
  }
  
  getAccount () {
      // If we have account cached, use it instead
      if (this.accountObservable === null) {
          this.accountObservable = this._http.get('http://localhost/api/account')
              .map(res =&gt; &lt;Account&gt; res.json().data)
              .catch(this.handleError);
      }
  
      return this.accountObservable;
  }
  </code></pre>
  
  <p>I have added that service in my bootstrap function to provide it globally (my hope is to provide the same instance to all components):</p>
  
  <pre><code>provide(AccountService, { useClass: AccountService })
  </code></pre>
  
  <p>The problem is when I call this service in different components, a GET request is made every time. So if I add it to 3 components, 3 GET requests will be made even though I check if an observable already exist.</p>
  
  <pre><code>ngOnInit() {
    this._accountService.getAccount().subscribe(
      account =&gt; this.account = account,
      error =&gt;  this.errorMessage = &lt;any&gt;error
    );
  }
  </code></pre>
  
  <p>How can I prevent the GET request to be made multiple times?</p>