title: Displaying data in a table using angular 5
body: <p>I'm trying to display data in a table I got the part from HTML working because I use to keep it empty and data will be shown when I do a search
  I want to change that to display data when I load the page and the table will be full.</p>
  
  <p>this is my service : 
  userservice.ts : </p>
  
  <pre><code>public getUserss() {
      return this.http.get('http://localhost:8081' + '/users');
  }
  </code></pre>
  
  <p>users.component.ts: this is where I need to implement the code: it's wrong</p>
  
  <pre><code>ngOnInit(): void {
      this.userservice.getUserss().subscribe();
  } 
  </code></pre>
  
  <p>the table that I want to display is a html table not material table : </p>
  
  <pre><code>  &lt;table class="table table-striped"&gt;
    &lt;tr&gt;
      &lt;th&gt;ID&lt;/th&gt;
      &lt;th&gt;Last Name&lt;/th&gt;
      &lt;th&gt;First Name&lt;/th&gt;
      &lt;th&gt;Email&lt;/th&gt;
      &lt;th&gt;Username&lt;/th&gt;
      &lt;th&gt;Password&lt;/th&gt;
      &lt;th&gt;Role&lt;/th&gt; &lt;th colspan="2"&gt;Actions&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr *ngFor="let u of pageUsers?.content"&gt;
      &lt;td&gt;{{u.id}}&lt;/td&gt;
      &lt;td&gt;{{u.nom}}&lt;/td&gt;
      &lt;td&gt;{{u.prenom}}&lt;/td&gt;
      &lt;td&gt;{{u.email}}&lt;/td&gt;
      &lt;td&gt;{{u.username}}&lt;/td&gt;
      &lt;td&gt;{{u.password}}&lt;/td&gt;
      &lt;td&gt;{{u.role}}&lt;/td&gt;
      &lt;td&gt;
        &lt;button style="color: #4CAF50;" class="glyphicon glyphicon-pencil" (click)="onEditUser(u.id)" &gt;&lt;/button&gt;
      &lt;/td&gt;
      &lt;td&gt;
        &lt;button style="color: red;" class="glyphicon glyphicon-trash" (click)="deleteuser(u)" &gt;&lt;/button&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I just want to know how to change my service and my component to display data on init</p>
  
  <p>JSON</p>
  
  <pre><code>[
    {
      "id": 1,
      "nom": "SBOUI",
      "prenom": "sameh",
      "email": "samehsboui_enicar@gmail.com",
      "username": "sameh",
      "password": "sameh",
      "role": "admin"
    },
    {
      "id": 3,
      "nom": "ORANGE",
      "prenom": "",
      "email": "orange@yahoo.com",
      "username": "OrangeIP",
      "password": "orange140",
      "role": "client"
    },
    {
      "id": 37,
      "nom": "try2name",
      "prenom": "try2 ",
      "email": "try@gmail.com",
      "username": "try158",
      "password": "zkndgkji",
      "role": "client"
    }
  ]
  </code></pre>