app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { HttpModule,Http } from '@angular/http';
import { IonicStorageModule } from '@ionic/storage';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { MyApp } from './app.component';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { RestApiProvider } from '../providers/rest-api/rest-api';
import { Device } from '@ionic-native/device';
import { GlobalsProvider } from '../providers/globals/globals';
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { OneSignal } from '@ionic-native/onesignal';
export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
declarations: [
MyApp
],
imports: [
BrowserModule,
HttpModule,
IonicStorageModule.forRoot(),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
}
}),
IonicModule.forRoot(Bharatgas),
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
],
providers: [
StatusBar,
SplashScreen,
Device,
{provide: ErrorHandler, useClass: IonicErrorHandler},
RestApiProvider,
GlobalsProvider,
InAppBrowser,
OneSignal
]
})
export class AppModule {}
(Page1) locate-distributor.ts
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams,ModalController } from 'ionic-angular';
import { NgForm,FormBuilder, FormGroup, Validators } from '@angular/forms';
import { ModalLocatdistbPage } from '../modal-locatdistb/modal-locatdistb';
@IonicPage()
@Component({
selector: 'page-locate-distributor',
templateUrl: 'locate-distributor.html',
})
export class LocateDistributorPage {
constructor(public navCtrl: NavController,
public navParams: NavParams,
public formBuilder: FormBuilder,
public modalCtrl: ModalController) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad LocateDistributorPage');
}
locateDistb(form: NgForm){
let profileModal = this.modalCtrl.create(ModalLocatdistbPage);
profileModal.present();
}
}
locate-distributor.module.ts
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { LocateDistributorPage } from './locate-distributor';
@NgModule({
declarations: [
LocateDistributorPage,
],
imports: [
IonicPageModule.forChild(LocateDistributorPage),
],
exports: [
LocateDistributorPage
]
})
export class LocateDistributorPageModule {}
Page 2 modal-locatdistb.tss)
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@IonicPage()
@Component({
selector: 'page-modal-locatdistb',
templateUrl: 'modal-locatdistb.html',
})
export class ModalLocatdistbPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad ModalLocatdistbPage');
}
}
modal-locatdistb.module.ts
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@IonicPage()
@Component({
selector: 'page-modal-locatdistb',
templateUrl: 'modal-locatdistb.html',
})
export class ModalLocatdistbPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad ModalLocatdistbPage');
}
}
Above code i am using, What i am missing in it ?