title: Ionic 4 Service constructor never called -> httpClient http.get fail
body: <p>I am lost here, i dont have a clue why i have this error:</p>
  
  <p>Its Ionic 4</p>
  
  <p>I have a service for all my rest api communication. <code>http</code> in the service is undefined, so <code>.post</code> fail. So why is my service constructor never called?</p>
  
  <pre><code>ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'post' 
  of undefined
  TypeError: Cannot read property 'post' of undefined
  at Object.&lt;anonymous&gt; (http-service.service.ts:27)
  ...
  </code></pre>
  
  <p><strong>http-service.service.ts:</strong></p>
  
  <pre><code>import {Injectable} from '@angular/core';
  import {HttpClient} from '@angular/common/http';
  
  @Injectable()
  export class HttpServiceService {
  constructor(
      private httpClient: HttpClient
  ) {
      console.log('service'); // not called
  }
  
  async poster() {
      console.log(this.httpClient); // undefined
       this.httpClient
          .post(this.backend_url, {/*params*/})
          .subscribe(res =&gt; {});
  
  }
  }
  </code></pre>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>...
  import {HttpClient} from '@angular/common/http';
  import {HttpClientModule} from '@angular/common/http';
  
  import {HttpServiceService} from './http-service.service';
  
  @NgModule({
      declarations: [AppComponent],
      entryComponents: [],
      imports: [
          BrowserModule,
          HttpClientModule,
          IonicModule.forRoot(),
          IonicStorageModule.forRoot(),
          AppRoutingModule,
      ],
      providers: [
          StatusBar,
          SplashScreen,
          HttpClient,
          HttpServiceService,
          {provide: RouteReuseStrategy, useClass: IonicRouteStrategy}
      ],
      bootstrap: [AppComponent]
  })
  export class AppModule {
  }
  </code></pre>
  
  <p><strong>some.page.ts</strong></p>
  
  <pre><code>import {HttpServiceService} from '../http-service.service';
  ...
  constructor(private http: HttpServiceService) {...}
  ....
  this.http.poster()
  </code></pre>
  
  <p><strong>UPDATE (2019-03-21 17:50 (GMT)):</strong>
  Already tried to.</p>
  
  <ul>
  <li>remove HttpClient from app.module.ts</li>
  <li>add @Injectable({ providedIn: 'root' })</li>
  <li>remove HttpServiceService from app.module.ts</li>
  <li>private http: Http; import {Http} from '@angular/http'; (deprecated btw)</li>
  </ul>
  
  <p>Look at the whole code: <a href="https://github.com/digital-scouts/Frontend/tree/dev/src/app" rel="nofollow noreferrer">https://github.com/digital-scouts/Frontend/tree/dev/src/app</a>
  My http-service is called in loading.page.ts:100</p>
  
  <p><strong>UPDATE END</strong></p>