I'm new to ionic2. There is something weird in it's routing compared to pure angular routing. In Angular:
const appRoutes: Routes = [
{ path: 'crisis-center', component: CrisisListComponent },
{ path: 'hero/:id', component: HeroDetailComponent },
{
path: 'heroes',
component: HeroListComponent,
data: { title: 'Heroes List' }
},
{ path: '',
redirectTo: '/heroes',
pathMatch: 'full'
},
{ path: '**', component: PageNotFoundComponent }
];
@NgModule({
imports: [
RouterModule.forRoot(appRoutes)
// other imports here
],
We pass a constant with type of Routes.
In Ionic (sidemenu starter) they pass a component to forRoot function.
import { MyApp } from './app.component';
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
],
Any idea?