Encountered an error: No provider for Http! Error: No provider for Http! at injectionError
Sample Component File:
import { Component,Injectable } from '@angular/core';
import { HttpModule, Http } from '@angular/http';
import { IonicPage, NavController, NavParams, AlertController } from 'ionic-angular';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { Camera } from 'ionic-native'
import firebase from 'firebase'
@IonicPage()
@Component({
selector: 'page-user-main',
templateUrl: 'user-main.html',
})
export class UserMainPage {
picdata:any
picurl:any
mypicref:any
public people: any;
constructor(public navCtrl: NavController, public navParams: NavParams,
public alertCtrl: AlertController, public http: Http
) {
// this.films = this.http.get('http://0.0.0.0:3000/');
}
}
module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule, Http } from '@angular/http';
import { IonicPageModule } from 'ionic-angular';
@NgModule({
declarations: [
UserMainPage,
],
imports: [
BrowserModule,
IonicPageModule.forChild(UserMainPage),
HttpModule
]})
export class UserMainPageModule {}
Runtime Error Uncaught (in promise): Error: No provider for Http! Error: No provider for Http! at injectionError (http://localhost:8100/build/vendor.js:1788:90) at noProviderError
UPDATE: Error Fixed after Adding Provider in App.module.ts