To import the module, I used this guide:
https://forum.ionicframework.com/t/guide-how-to-update-to-ionic-3-x/87516
But still it does not work. The application is created on Ionic 3.
What is the problem?
app.modules.ts
import { HTTP } from ‘@ionic-native/http’;
import { HttpModule } from ‘@angular/http’;
import { HttpClientModule } from ‘@angular/common/http’;import { NgModule, ErrorHandler } from ‘@angular/core’;
import { BrowserModule } from ‘@angular/platform-browser’;
import { IonicApp, IonicModule, IonicErrorHandler } from ‘ionic-angular’;
import { MyApp } from ‘./app.component’;
import { Page1Page } from ‘…/pages/page1/page1’;
import { Page2Page } from ‘…/pages/page2/page2’;
import { Page3Page } from ‘…/pages/page3/page3’;
import { Page4Page } from ‘…/pages/page4/page4’;
import { Page5Page } from ‘…/pages/page5/page5’;import { StatusBar } from ‘@ionic-native/status-bar’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;@NgModule({
declarations: [
MyApp,
Page1Page,
Page2Page,
Page3Page,
Page4Page,
Page5Page
],
imports: [
BrowserModule,
HttpModule,
HttpClientModule,
IonicModule.forRoot(MyApp)
page5.ts
import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { FormGroup, Validators, FormBuilder } from ‘@angular/forms’;import { HTTP } from ‘@ionic-native/http’;
import { HttpModule } from ‘@angular/http’;
@Component({
selector: ‘page-page5’,
templateUrl: ‘page5.html’
})
export class Page5Page {private baseURI : string = “https://sportcomp.000webhostapp.com/”;
constructor(public navCtrl : NavController,
public http : Http,
public NP : NavParams,
public fb : FormBuilder,
public toastCtrl : ToastController)ionViewWillEnter()
{
this.load();
}// Retrieve the JSON encoded data from the remote server
// Using Angular’s Http class and an Observable - then
// assign this to the items array for rendering to the HTML template
load()
{
this.http.get(‘https://sportcomp@files.000webhost.com/mobileapp/retrieve-data.php’)
}
}
index.html
Error on page5.ts (or Registration page)
Runtime Error
Cannot read property ‘get’ of undefined
And after starting the server, too, it gives an error, until I re-save any file.
Typescript Error
Constructor implementation is missing.
c:/Android/
constructor(public navCtrl : NavController,
public http : Http,
I’m going to bind the user registration and the input to the MySQL database.
Help me please.