title: ionic-native/http emit error “NullInjectorError: No provider for HTTP!”
body: <p>I'm using <em>ionic 3.2</em> and angular, for install <code>HTTP</code> (<a href="https://ionicframework.com/docs/native/http/" rel="nofollow noreferrer">https://ionicframework.com/docs/native/http/</a>) I use this commands:</p>
  
  <pre><code>ionic cordova plugin add cordova-plugin-advanced-http
  npm install --save @ionic-native/http
  </code></pre>
  
  <p>In script <code>autenticar.ts</code> I added the <code>import { HTTP } from '@ionic-native/http';</code> like this:</p>
  
  <pre><code>import { Component, ViewChild } from '@angular/core';
  import { NavController } from 'ionic-angular';
  import { HTTP } from '@ionic-native/http';
  
  @Component({
    selector: 'page-autenticar',
    templateUrl: 'autenticar.html'
  })
  export class AutenticarPage {
  
    @ViewChild('username') username;
    @ViewChild('password') password;
  
    constructor(public navCtrl: NavController, public http: HTTP) {
      console.log(http)
    }
  
  ...
  </code></pre>
  
  <p>After reload app I get this error:</p>
  
  
  
  <blockquote>
  <pre><code>Runtime Error
  Uncaught (in promise): Error: StaticInjectorError(AppModule)
  [AutenticarPage -&gt; HTTP]: StaticInjectorError(Platform: core)[AutenticarPage -&gt; HTTP]:
  NullInjectorError: No provider for HTTP!
  Error: StaticInjectorError(AppModule)[AutenticarPage -&gt; HTTP]:
  StaticInjectorError(Platform: core)[AutenticarPage -&gt; HTTP]:
  NullInjectorError: No provider for HTTP! at _NullInjector.get
  (http://localhost:8100/build/vendor.js:1376:19) at resolveToken
  (http://localhost:8100/build/vendor.js:1674:24) at tryResolveToken
  (http://localhost:8100/build/vendor.js:1616:16) at StaticInjector.get
  (http://localhost:8100/build/vendor.js:1484:20) at resolveToken
  (http://localhost:8100/build/vendor.js:1674:24) at tryResolveToken
  (http://localhost:8100/build/vendor.js:1616:16) at StaticInjector.get
  (http://localhost:8100/build/vendor.js:1484:20) at resolveNgModuleDep
  (http://localhost:8100/build/vendor.js:11228:25) at NgModuleRef_.get
  (http://localhost:8100/build/vendor.js:12461:16) at resolveDep
  (http://localhost:8100/build/vendor.js:12951:45)
  </code></pre>
  </blockquote>
  
  <p>I try this <a href="https://stackoverflow.com/a/47492777/1518921"><strong>answer</strong></a>, says I have to add the <code>app.module.ts</code> this <code>import { HttpModule } from '@angular/http';</code>, like this:</p>
  
  <pre><code>import { NgModule, ErrorHandler } from '@angular/core';
  import { BrowserModule } from '@angular/platform-browser';
  import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
  import { HttpModule } from '@angular/http';
  import { MyApp } from './app.component';
  
  ....
  
    imports: [
      BrowserModule,
      HttpModule,
      IonicModule.forRoot(MyApp)
    ],
  
  ...
  </code></pre>
  
  <p>But still the same error.</p>