title: How can I pass an argument to a provider constructor in Ionic2 / Angular2?
body: <p>I am trying to port my Ionic2.beta11 App to the new Ionic2.rc0 release. Most things were pretty straight forward, but I have a problem with the AoT compiler.</p>
  
  <p>I have an AuthService:</p>
  
  <pre><code>@Injectable()
  export class AuthService {
    constructor(@Inject(Http) http: Http) {
      this.http = http;
    }
    ...
  }
  </code></pre>
  
  <p>I'm injecting it into my app in the <code>src/app/app.module.ts</code> file:</p>
  
  <pre><code>@NgModule({
    declarations: [
      MyApp,
      ...
    ],
    imports: [
      IonicModule.forRoot(MyApp)
    ],
    bootstrap: [IonicApp],
    entryComponents: [
      MyApp,
      ...
    ],
    providers: [
      AuthService
    ]
  })
  </code></pre>
  
  <p>Everything works fine when running ionic serve, but when I try to build it I get the following error:</p>
  
  <pre><code>ngc error: Error: Error at .../.tmp/app/app.module.ngfactory.ts:397:78: Supplied parameters do not match any signature of call target.
  </code></pre>
  
  <p>Lines 396 - 399:</p>
  
  <pre><code>get _AuthService_74():import44.AuthService {
    if ((this.__AuthService_74 == (null as any))) { (this.__AuthService_74 = new import44.AuthService()); }
    return this.__AuthService_74;
  }
  </code></pre>
  
  <p>The problem is that <code>new import44.AuthService()</code> expects an argument of type http.</p>
  
  <p>The interesting thing is that everything works fine when I manually replace <code>constructor(http: Http)</code> with <code>constructor()</code> in the definition file. </p>
  
  <p>I read through all the StackOverflow answers I could find, but none of the solutions solved my problem.</p>
  
  <p>Do I need to change the constructor in the AuthService or the way how I inject it into my app? Thank you for your help.</p>