Skip to content

Commit ba668a8

Browse files
Broccohansl
authored andcommitted
chore(routes): simpplify route generation for modules (angular#2040)
1 parent f7415af commit ba668a8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

addon/ng2/blueprints/module/files/__path__/__name__.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';<% if (routing) { %>
3-
import { <%= classifiedModuleName %>RoutingModule } from './<%= dasherizedModuleName %>.routing';<% } %>
3+
import { <%= camelizedModuleName %>Routing } from './<%= dasherizedModuleName %>.routing';<% } %>
44

55
@NgModule({
66
imports: [
77
CommonModule<% if (routing) { %>,
8-
<%= classifiedModuleName %>RoutingModule<% } %>
8+
<%= camelizedModuleName %>Routing<% } %>
99
],
1010
declarations: []
1111
})
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import { NgModule } from '@angular/core';
21
import { Routes, RouterModule } from '@angular/router';
32

4-
const routes: Routes = [];
3+
export const <%= camelizedModuleName %>Routes: Routes = [];
4+
5+
export const <%= camelizedModuleName %>Routing = RouterModule.forChild(<%= camelizedModuleName %>˝Routes);
56

6-
@NgModule({
7-
imports: [RouterModule.forChild(routes)],
8-
exports: [RouterModule],
9-
})
10-
export class <%= classifiedModuleName %>RoutingModule { }

0 commit comments

Comments
 (0)