title: inject http or service inside static
body: <p>I am making validation on angular2 through GlobalValidaitor.ts  file i put on it all extra method that i need as following </p>
  
  <pre><code>import { FormControl } from '@angular/forms';
  import { Http } from '@angular/http';
  import { Api } from '../providers/api';
  import 'rxjs/add/operator/map';
  import 'rxjs/add/operator/toPromise';
  
  
  export class GlobalValidator {
  
  
     constructor(public Api: Api) {
  
    }
  
  
  
    public  static checkEmailExisit(control: FormControl): any {
       return new Promise(resolve =&gt; {
  
        //Fake a slow response from server
  
        let  senddata: {email?: string} = {
          email : control.value
        };
  
  
        let seq = this.Api.post('phones/offers', senddata).share() ;
      seq
       .map(res =&gt; res.json())
       .subscribe(res =&gt; {
       resolve(res);
       });
  
      });
  
    }
  
  
  
    static mailFormat(control: FormControl): any {
  
      var EMAIL_REGEXP = /^(([^&lt;&gt;()\[\]\\.,;:\s@"]+(\.[^&lt;&gt;()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
  
      if (control.value != "" &amp;&amp; (control.value.length &lt;= 5 || !EMAIL_REGEXP.test(control.value))) {
          return { "incorrectMailFormat": true };
      }
  
      return null;
  }
  
  
  
  
  }
  </code></pre>
  
  <p>and as its a static don't consider API
  i will be thankful to help in angular 2 not the last version it shall be usage of HTTP_PROVIDER and inject directly onside the function 
  but for the last version of angular it don't work i event cant import HTTP_PROVIDER </p>