No provider for Http! error in ionic


Thank Josh, you saved me a ton of time and frustration! :slight_smile:

Next drink is on me :wink:


thank you very much! saved my life :slight_smile:


TY for all your Ionic help… The world is better with this :sunny:


Thanks alot Yahoooooo <3


Thank you @joshnash :slight_smile:


@joshmorony for president :raised_hand_with_fingers_splayed:t5::grimacing:



Thank you Josh!


Great men, thanks, it worked for me


Exactly what i need to fix my issue. Million thanks.


It works perfectly, thank you


To me I get the following error I already made all imports of both the http and the HttpModule but console tells me the following I could do in that case.
Help me please.
XMLHttpRequest cannot load No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8100’ is therefore not allowed access.


Thanks You @joshmorony you saved my evening :slight_smile:


I used
import {HttpModule} from '@angular/Http’
and it didn’t work.
But when I used
import {HttpModule} from '@angular/http’
it worked.
It seems the imports are CASE-SENSITIVE.


Depends on your filesystem.


Helped me too. Thanks Josh



Is the procedure for importing/Defining services or modules like http and all in app.module.ts in both “ionic2” and “ionic3” same?? …
I am doing a project in ionic 3 for that I am referring ionic 2 project videos .
please help me


thank you dude, save my time.


in home.ts file i’ve this list of params

var params = {
                  service: this.toBase64('register'),
                  device_id: this.toBase64(this.device.uuid),
                  org_name: this.toBase64(this.orgName),
                  org_email: this.toBase64(this.orgMail),
                  org_address: this.toBase64(this.orgAddress),
                  org_boardnumber: this.toBase64(this.boardNumber),
                  org_password: this.toBase64(this.password),
                  org_phone: this.toBase64(this.orgPhone)

           .subscribe(response => console.log(response))

there is method postRequest() in Provider there is file register.ts. Here is method implementation.

postRequest(params) {
        var headers = new Headers();
        headers.append("Accept", 'application/json');
        headers.append('Content-Type', 'application/json' );
        headers.append('Access-Control-Allow-Origin', '*' );
        let options = new RequestOptions({ headers: headers });
     let jsonData = JSON.stringify(params)
    return, jsonData, options)
          .map(response => response.json());

when i run application. this error appears

Screen Shot 2017-11-21 at 12.38.59 PM.png

Can anyone help me where i made mistake.Thanks


thank you! !!!


Thanks! Solved the problem. Had to change it from HttpClient to just Http in the constructor.