title: http.put request is executed twice in Angular2
body: <p>I am trying to update a company record calling an API from my Angular2 application. I noticed while debugging that the http call is being executed twice. I found another <a href="https://stackoverflow.com/questions/37241294/angular2-http-post-gets-executed-twice">stackoverflow thread</a> that is identical to this and the answer was to add <code>.share()</code> due to hot and cold Observables. I have added this to my http call but this did not resolve the issue. I appreciate any assistance!</p>
  
  <p><a href="https://i.stack.imgur.com/sSxbT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sSxbT.png" alt="enter image description here"></a></p>
  
  <p><strong>company.service.ts</strong></p>
  
  <pre><code>update(company: Company): Observable&lt;Company&gt; {
      return this._http.put(URL_COMPANY, JSON.stringify(company), { headers: this.headers })
          .map((res: Response) =&gt; company).share();
  }
  
  getCompanies() {
      return this._http.get(URL_COMPANY)
          .map((response: Response) =&gt; response.json()).share()
          .catch(this.handleError);
  }
  
  getCompany(id: number): Promise&lt;Company&gt; {
      const url = `${URL_COMPANY}/${id}`;
  
      return this._http.get(url)
          .toPromise()
          .then(response =&gt; response.json() as Company)
          .catch(this.handleError);
  }
  </code></pre>
  
  <p><strong>company.component.ts</strong></p>
  
  <pre><code>    ngOnInit(): void {
  
  
                  this.route.params.switchMap((params: Params) =&gt; this.companyService.getCompany(+params['id']))
                  .subscribe(company =&gt; this.company = company);
      }    
  
  save(): void {
          this.companyService.update(this.company).subscribe(
             (worked) =&gt; { console.log("success")},
             (error) =&gt; { console.log("failed")}
          );
      }
  </code></pre>