title: Angular Observables vs Promise CRUD and refreshing data
body: <p>I have a few questions regarding angular 2/4 pattern for simple crud application. Most the examples I've viewed, I don't see how the data is refreshed after insert/updating, etc.. </p>
  
  <p>I'm a bit new with Observables but understand most of the pattern with the exception with refreshing data after an insert/update/delete. Can someone explain the best way to refresh data and do I really need to use Observables instead of promises ? Is it accepted to still use promises? </p>
  
  <p>How do I do the following below with Observables?</p>
  
  <p><strong>users.service</strong></p>
  
  <pre><code>insertPromise(user : User)
  {
      let headers = new Headers({ 'Content-Type': 'application/json' });
      let options = new RequestOptions({ headers: headers });
      let url = this.baseUrl;
  
      return this.http.post(url, JSON.stringify(user),options)          
            .do(data=&gt;console.log(JSON.stringify(data))) 
            .toPromise()
            .then(this.extractPromiseData)          
            .catch(this.handleError);
  }
  
  insertObservable(user : User) {
  
      this.usersService.insert(user)
        .subscribe(
        resp =&gt; {
  
          console.log(resp);
        },
        error =&gt; this.errorMessage = &lt;any&gt;error);
    }
  </code></pre>
  
  <p><strong>user-list.component</strong> (Contains refresh after insert)</p>
  
  <pre><code>insert(user: User)
  {
       this.usersService.insertPromise(user)
           .then(result=&gt;console.log(result))
           .then(
             ()=&gt;this.usersService.getAllUsers()
             .then(
               users=&gt;
  
               this.users = users
  
               )
             .catch(error=&gt;console.log(error))           
             )
           .catch(error=&gt;console.log(error));
  }
  
  insertObservable(user: User)
    {
  
      let headers = new Headers({ 'Content-Type': 'application/json' });
      let options = new RequestOptions({ headers: headers });
      let url = this.baseUrl;
  
       return this.http.post(url, JSON.stringify(user),options)
            .map((response: Response) =&gt; response.json())
            .do(data=&gt;console.log(JSON.stringify(data)))  
            .catch(this.handleError);
    }
  </code></pre>