Error in Http Module

I tried building the ionic app and I recieve the following error.

[19:18:57]  typescript: C:/Users/MANAV/ionreddit/src/app/services/reddit.service
.ts, line: 11
            Cannot find name 'Http'.

      L11:      constructor(http:Http){

I did change the import {HttpModule} from ‘@angular/http’ in app.module.ts
and added HttpModule in import: [… ]

Can anyone help please :confused:

You should need add app.module.ts.

imports: [HttpModule]

regard.

@rdlabo I already did this. It still gives the error

Check if this line is there in your app.module.ts file
import { HttpModule } from '@angular/http';

Also do this after importing(in this sequence only)

imports:[
    BrowserModule,
    HttpModule,
    IonicModule.forRoot(MyApp)
]

hope it works

tried pubic http: Http ? And did you import it (not only added it to the imports) add app.module, since you only posted a prtial screenshot.

I did all that . No luck :frowning:

I think the answer is in the only usable information OP posted in the entire thread (in that it’s actually readable):

reddit.service.ts: Cannot find name 'Http'

So that tells me that there is no import for Http in reddit.service.ts.

1 Like

I think you’re the only one that really paid attention to that one :smile:

I am sorry but the import for Http is already there.

I hate it when people post screenshots of code. It’s lazy and selfish, because (among many other reasons) other people with similar problems can’t search and find advice given to you. That being said, you misspelled “@angular”, and if your IDE didn’t flag that, I would look for a better IDE.

1 Like

Oh shit :hushed:. Thank You