Skip to content

Commit

Permalink
fix(routing): split out routes into routing module (ionic-team#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd authored Oct 22, 2019
1 parent 5b611c3 commit b13b823
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { <%= classify(name) %>Page } from './<%= dasherize(name) %>.page';

const routes: Routes = [
{
path: '',
component: <%= classify(name) %>Page
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class <%= classify(name) %>PageRoutingModule {}
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';

import { IonicModule } from '@ionic/angular';

import { <%= classify(name) %>Page } from './<%= dasherize(name) %>.page';
import { <%= classify(name) %>PageRoutingModule } from './<%= dasherize(name) %>-routing.module';

const routes: Routes = [
{
path: '',
component: <%= classify(name) %>Page
}
];
import { <%= classify(name) %>Page } from './<%= dasherize(name) %>.page';

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
<%= classify(name) %>PageRoutingModule
],
declarations: [<%= classify(name) %>Page]
})
Expand Down

0 comments on commit b13b823

Please sign in to comment.