title: Angular Material 2: How to refresh md-table after add data to datasource?
body: <p>Could someone put a complete example of a mat-table with datasource adding a data later on when the table is loaded and the table is updated?</p>
  
  <p>My program manages to show the table, the load of data, the dialog box that asks for the new data, the data to add to the database, but I do not know how to refresh the table</p>
  
  <p>I found this example </p>
  
  <pre><code>    connect(): Observable&lt;UserVModel[]&gt; {
    return this._userService.dataChanged
        .switchMap(() =&gt; this._userService.getAllUsers()
  }
  </code></pre>
  
  <p>in this link:
  <a href="https://stackoverflow.com/questions/45288271/angular-material-2-how-to-refresh-md-table-after-editing-a-record">Angular Material 2: How to refresh md-table after editing a record?</a></p>
  
  <p>But I do not know how to implement it.</p>
  
  <p>Thank you</p>