title: Private http: HttpClient in or out of constructor?
body: <p>If I use:</p>
  <pre><code>private http: HttpClient
  constructor () {
  }
  </code></pre>
  <p>I get ERROR TypeError: Cannot read property 'post' of undefined</p>
  <p>If I use:</p>
  <pre><code>constructor(private http: HttpClient) {
  }
  </code></pre>
  <p>I get Uncaught Error: Can't resolve all parameters for DataService: (?).</p>
  <pre><code>import { Injectable } from &quot;@angular/core&quot;;
  import { Observable, BehaviorSubject, concat } from &quot;rxjs&quot;;
  
  import { map } from 'rxjs/operators';
  import { HttpClient } from '@angular/common/http';
  
  export class DataService {
    
  
    constructor(private http: HttpClient) {
  
    }
  
    private token: string = &quot;&quot;;
    private tokenExpiration: Date;
    public store: string = &quot;&quot;;
    public user: string = &quot;&quot;;
  
    public login(creds) {
      this.store = creds.strNum;
      this.user = creds.empID;
      return this.http.post(&quot;/Account/CreateToken&quot;, creds)
        .pipe(map(response =&gt; {
          let tokenInfo = response;
          this.token = tokenInfo[&quot;token&quot;];
          this.tokenExpiration = tokenInfo[&quot;expiration&quot;];
  
          return true;
        }));
    }
  
  }
  </code></pre>
  <p>Not sure where to turn.</p>