Hi everyone,
Ionic 3
Angular 5
i have a problem with lazy loading, trying to navigate from side-menu witch is generated from starter-template.
import {Component, NgModule, ViewChild} from '@angular/core';
import {IonicPage, IonicPageModule, NavController, Platform} from 'ionic-angular';
import {StatusBar} from '@ionic-native/status-bar';
import {SplashScreen} from '@ionic-native/splash-screen';
import {HomescreenPage} from "../pages/homescreen/homescreen";
import {HomePage} from "../pages/home/home";
import {SupportPage} from "../pages/support/support";
@IonicPage()
@Component({
templateUrl: 'app.html'
})
@NgModule({
imports: [
IonicPageModule.forChild(HomePage)
],
exports: [],
declarations: [HomePage],
providers: [],
})
export class MyApp {
[x: string]: any;
rootPage: any = 'HomescreenPage';
pages: Array<{ title: string, component: any }>;
constructor(private nav: NavController, public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
this.initializeApp();
// used for an example of ngFor and navigation
this.pages = [
// { title: 'Support', component: SupportPage },
];
}
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
openPage(page) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
this.nav.setRoot(page.component);
}
navigateToSupportPage() {
this.navCtrl.push('SupportPage');
}
}
html look like this
<div class="side-menu-button" (click)="navigateToSupportPage()"><i class="fa fa-question menu-icon" aria-hidden="true"></i>Support</div>
Any idea why after button clicking does not anything?