title: Angular2 - Ionic 2: Injection in Service not working
body: <p>I'm beginner and playing around with Ionic2 (written on Angular2). I need help to solve a issue with Dependency Injection in my own service. </p>
  
  <p>Here's my code</p>
  
  <pre><code>import {Injectable} from 'angular2/core';
  import {Http} from 'angular2/http';
  
  @Injectable()
  export class Api {
      constructor(public http: Http) {
          console.log('api', http); // http is always undefined.
      }
  }
  
  
  api = new Api();
  </code></pre>
  
  <p>Other case, it works.</p>
  
  <pre><code>import {Component, View} from 'angular2/angular2';
  import {IONIC_DIRECTIVES} from 'ionic/ionic';
  import {Http, Headers} from 'angular2/http';
  import {Storage, LocalStorage} from 'ionic/ionic';
  
  @Component({
      selector: 'auth-login'
  })
  
  @View({
    templateUrl: 'app/auth_login/auth_login.html',
    directives: [IONIC_DIRECTIVES]
  })
  
  export class AuthLogin {
    constructor(http: Http) {
      console.log('login', http); // it works
    }
  }
  </code></pre>
  
  <p>Thank you all.</p>