title: Type Promise<void> is not assignable to type Promise<customType[]>
body: <p>I am new to angularJs2. I have created following service:   </p>
  
  <pre><code>import { Injectable, OnInit } from '@angular/core';
  import { customType } from '../models/currentJobs';
  import { Headers, Http } from '@angular/http';
  
  import 'rxjs/add/operator/toPromise';
  
  @Injectable()
  export class JobService implements OnInit {
  
      constructor(private http: Http) { }
  
      ngOnInit(): void {
          this.getCurrentJobs();
      }
  
      private headers: Headers = new Headers({ 'Content-Type': 'application/json' });
      private ordersUrl: string = 'http://localhost:35032/api/order/';
  
      public orders: customType[];
  
      getCurrentJobs(): Promise&lt;customType[]&gt; {
          var jobs =  this.http.get(this.ordersUrl)
              .toPromise()
              .then(response =&gt; {
                  this.orders = response.json() as customType[];
              })
              .catch(this.handleError);
          return jobs;//this line throws error
      }
  
      private handleError(error: any): Promise&lt;any&gt; {
          console.error('An error occurred', error);
          return Promise.reject(error.message || error);
      }
  }
  </code></pre>
  
  <p>Following are my Typescript compile configuration of Vs2017</p>
  
  <p><a href="https://i.stack.imgur.com/qFitV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qFitV.png" alt="enter image description here"></a></p>
  
  <p>When I compile the code using visual studio 2017 I get following error</p>
  
  <p><code>**TS2322   Build:Type 'Promise&lt;void&gt;' is not assignable to type 'Promise&lt;customType[]&gt;'.*</code>*    </p>
  
  <p>Help me to fix this error.</p>