Navigation Through a Side Menu
An overview of how navigation is implemented in an Ionic project using the side menu template.
We'll cover the following...
Below is an Ionic project created using the sidemenu
template which, as the name implies, features a side menu for navigation in the content area.
Run the app below.
import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import { FolderPage } from './folder.page'; const routes: Routes = [ { path: '', component: FolderPage } ]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) export class FolderPageRoutingModule {}
Sample app using the side menu template
The side menu template
Implementing a side menu within an Ionic app is really only a UI enhancement because, unlike the tabs template, there is only a single root page. The NavController
object is used to push and pop pages if necessary for the navigation stack based on the selected menu option.
That said, there are a few things to be ...