Here is some code, sorry for the large dump.
Home Page Module
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { HomePageRoutingModule } from './home-routing.module';
import { HomePage } from './home.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HomePageRoutingModule
],
declarations: [HomePage]
})
export class HomePageModule {}
Home page Routing module.
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomePage } from './home.page';
const routes: Routes = [
{
path: '',
component: HomePage
},
{
path: 'page1',
loadChildren: () => import('./page1/page1.module').then( m => m.Page1PageModule)
},
{
path: 'page2',
loadChildren: () => import('./page2/page2.module').then( m => m.Page2PageModule)
},
{
path: 'page3',
loadChildren: () => import('./page3/page3.module').then( m => m.Page3PageModule)
},
{
path: 'page4',
loadChildren: () => import('./page4/page4.module').then( m => m.Page4PageModule)
},
{
path: 'page5',
loadChildren: () => import('./page5/page5.module').then( m => m.Page5PageModule)
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HomePageRoutingModule {}
Home.page.ts
import { Component, OnInit, NgZone } from '@angular/core';
import { Router } from '@angular/router';
import { CustomViewInfo, CustomViewButtons } from '../../models/customViewInfo';
import { NGXLogger } from 'ngx-logger';
import { FirebaseService } from 'src/providers/firebase/firebase.service';
import { Storage } from '@ionic/storage';
@Component({
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss'],
})
export class HomePage implements OnInit {
constructor(
private zone: NgZone,
private router: Router,
private storage: Storage,
private logger: NGXLogger,
private firebaseService: FirebaseService,
) {
}
Page1 Module
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { Page1PageRoutingModule } from './page1-routing.module';
import { Page1Page } from './page1.page';
import { UtilityModule } from 'src/app/utility/utility.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
Page1PageRoutingModule,
UtilityModule
],
declarations: [Page1Page]
})
export class Page1PageModule {}
Submodule Page1.page.ts
import { Component, OnInit, OnDestroy } from '@angular/core';
import { FirebaseService } from 'src/providers/firebase/firebase.service';
import { NGXLogger } from 'ngx-logger';
import { AlertController } from '@ionic/angular';
import { DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'app-page1',
templateUrl: './page1.page.html',
styleUrls: ['./page1.page.scss'],
})
export class Page1Page implements OnInit, OnDestroy {
constructor(
private firebaseService: FirebaseService,
private logger: NGXLogger,
private alertCtrl: AlertController,
private sanitizer: DomSanitizer,
private platform: Platform
) { }
async showAlertOnStart() {
console.log('alert control showing');
const alert = await this.alertCtrl.create({
header: 'Warning',
subHeader: 'You must be a member of a group to send a message',
buttons: [{
text: 'Dismiss',
role: 'cancel',
cssClass: 'secondary',
handler: () => {
console.log('Confirmed Dismiss');
}
}],
backdropDismiss: false,
});
await alert.present();
}
Ionic Info
Ionic:
Ionic CLI : 5.2.5 (/Users/Mohammad/.nvm/versions/node/v8.12.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.10
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.1.2
Capacitor:
Capacitor CLI : not installed
@capacitor/core : not installed
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (10 plugins total)
Utility:
cordova-res : not installed
native-run : 0.2.3 (update available: 0.3.0)
System:
Android SDK Tools : 26.1.1 (/Users/Mohammad/Library/Android/sdk)
ios-deploy : 1.9.4
NodeJS : v10.19.0 (/Users/Mohammad/.nvm/versions/node/v10.19.0/bin/node)
npm : 6.13.4
OS : macOS Catalina
Xcode : Xcode 11.3.1 Build version 11C504
────────────────────────────────────────────────