title: Inject Http manually in Angular 2
body: <p>I have created a Base Model in which I have all the common functions to fetch data and post or put the data. Actually what a service does in Angular but I don't want a service.</p>
  
  <p>Now what I am planning to do is The base model will extended by all the modules in my system each module having its base endpoint to get data from the API. Now here's the problem If I inject the Http service in base model and the user model extends the Base model, Now to create a object of base model I need to pass the object of Http which I am unable.</p>
  
  <pre><code>export class BaseModel {
  constructor (http: Http) {}
  
  fetch() {
  let params = {
              "includes": this.includes,
              "page": page,
              "filters" : this.filters,
              "order" : this.orderDirection + this.orderColumn
          };
  
          return this.api.get("/"+this.endpoint, params)
              .map(
                  (response: any) =&gt; {
                      let total = response.meta.total;
                      let current = response.meta.current;
  
                      let min = current - 5;
                      let max = current + 5;
  
                      if (min &lt; 1) {
                          min = 1;
                      }
  
                      if (max &gt; total) {
                          max = total;
                      }
                      else if (max &lt; 10) {
                          if(total &lt; 10) {
                              max = total;
                          }else {
                              max = 10;
                          }
                      }
  
                      let pages : number[] = [];
  
                      for (let i = min; i &lt;= max; i++) {
                          pages.push(i);
                      }
  
                      this.pages = pages;
  
                      return response
                  }
              );
  }
  }
  </code></pre>
  
  <p>Now my User Model</p>
  
  <pre><code>export class User extends BaseModel {
  
  public id : number;
      public username : string;
      public email : string;
      public password : string;
      public passwordConfirmation : string;
      public details : UserDetail = new UserDetail();
      public type : string;
      public status : string;
      public profileImage : string;
      public profileImageUrl : string;
      public crop : Object = {};
      public lastLogin : string;
      public numberOfLogin : string;
      public joinDate : string;
      public registerType : string = "web";
  
      public static create(response : any) {
  
          if (response === undefined || response === null) {
              return response;
          }
  
          let details = new UserDetail();
  
          if (response.details) {
              details = UserDetail.create(response.details);
          }
  
          let user = new User(); //error parameter required
          user.id = response.id;
          user.username = response.username;
          user.email = response.email;
          user.status = response.status;
          user.type = response.type;
          user.details.id = response.details.id;
          user.details = details;
          user.profileImageUrl = response.profile_image_url;
          user.joinDate = response.created_at;
          user.registerType = response.register_type;
  
          return user;
      }
  
  }
  </code></pre>