2
私はionic2を初めて使用しています。純粋な角度ルーティングと比較してルーティングに奇妙なものがあります。角度で:角度ルーティングとIonicルーティング
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
],
Routes
の定数を渡します。
イオン性のもの(sidemenu)では、それらはコンポーネントをforRoot
関数に渡します。
import { MyApp } from './app.component';
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
],
http://ionicframework.com/docs/api/navigation/NavController/ –