any
Cannot use namespace ‘Http’ as a type.ts(2709)
Peek Problem (Ctrl+K N)
No quick fixes available
I get the above error in my login.ts
Below is my login.ts code:
import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams, ToastController, AlertController, Events } from ‘ionic-angular’;
import { Http } from ‘@angular/http’;
import { Storage } from ‘@ionic/storage’;
@IonicPage({})
@Component({
selector: ‘page-login’,
templateUrl: ‘login.html’,
})
export class Login {
username: string;
password: string;
constructor(public navCtrl: NavController, public navParams: NavParams, public http: Http, public toastCtrl: ToastController, public storage: Storage, public alertCtrl: AlertController, public events: Events) {
this.username = "";
this.password = "";
}
Below is my app.module.ts code
import { BrowserModule } from ‘@angular/platform-browser’;
import { ErrorHandler, NgModule } from ‘@angular/core’;
import { IonicApp, IonicErrorHandler, IonicModule } from ‘ionic-angular’;
import { MyApp } from ‘./app.component’;
import { Cart } from ‘…/pages/cart/cart’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { HttpModule } from ‘@angular/http’;
import { PayPal } from ‘@ionic-native/paypal’;
import { IonicStorageModule } from ‘@ionic/storage’;
import { OneSignal } from “@ionic-native/onesignal”;
import { WoocommerceProvider } from ‘…/providers/woocommerce/woocommerce’;
@NgModule({
declarations: [
MyApp,
Cart
],
imports: [
BrowserModule,
HttpModule,
IonicModule.forRoot(MyApp),
IonicStorageModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
Cart
],
providers: [
StatusBar,
SplashScreen,
PayPal,
OneSignal,
{provide: ErrorHandler, useClass: IonicErrorHandler},
WoocommerceProvider
]
})
export class AppModule {}
Any help will be highly appreciated.
3 posts - 2 participants