Fetching data from database into angular datatable
<p>I have some data stored in my database which i want to fetch and place in my angular datatable, but it doesn't work out and i can't find the reason why. Although, the instances i create in the constructor show up in my angular table, but i want to be able to request the stored data in my database into my angular datatable. Thanks!</p>

<p>customer.ts file</p>

<pre><code>import {Component, OnInit} from '@angular/core';
import {HttpService} from "./Client_Service";
import {Response} from '@angular/http';

@Component({
  selector: 'client',
  templateUrl:'client_table.html',
  providers:[HttpService]


})

  export class ClientComponent{

  welcome: string;
  clients: [{
     Name: string,
     Email: string,
     Company: string

  }];

  constructor(){
    this.welcome = "Customer Listing"
    this.clients = [{
      Name: "John Jan",
      Email:"example.com",
      Company: "Metabo"
    }

    ]

  };



   customers:Customer[];

   constructor(private httpService: HttpService){}

  ngOnInit(){


    this.httpService.getCustomer()
      .subscribe(
        (data: Response ) =&gt; console.log(data.json())
      );

  }




}
</code></pre>

<p>// My angular datatable</p>

<pre><code>&lt;h1&gt;{{welcome}}&lt;/h1&gt;
&lt;table class="table"&gt;

  &lt;tr&gt;
    &lt;th&gt;#&lt;/th&gt;
    &lt;th&gt; Name&lt;/th&gt;
    &lt;th&gt;Email&lt;/th&gt;
    &lt;th&gt;Company&lt;/th&gt;



 &lt;/tr&gt;
    &lt;tr *ngFor="let client of clients; let i = index"&gt;
      &lt;td&gt;{{i + 1}}&lt;/td&gt;
      &lt;td&gt;{{client.Name}}&lt;/td&gt;
      &lt;td&gt;{{client.Email}}&lt;/td&gt;
      &lt;td&gt;{{client.Company}}&lt;/td&gt;

    &lt;/tr&gt;


&lt;/table&gt;
</code></pre>

<p>// Http service </p>

<pre><code>import {Injectable} from '@angular/core';
import {Response, Http} from '@angular/http';
  import {DataListModule} from 'primeng/primeng';


@Injectable()

 export class HttpService{

  constructor(private http:Http){

  }

   getCustomer(){
     //using get request
     return this.http.get('http://localhost:9000/api/crm_api/v1/customers')
       .map((response: Response) =&gt; response.json())



   }





}
</code></pre>