File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
packages/schematics/angular/module
files/__name@dasherize@if-flat__ Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ const routes: Routes = [
11
11
@NgModule({
12
12
declarations: [],
13
13
imports: [<% if (commonModule) { %>
14
- CommonModule<%= routing || lazyRouteWithRouteModule ? ',' : '' %><% } %><% if (routing || lazyRouteWithRouteModule) { %>
15
- <%= classify(name) %>RoutingModule<% } %><%= lazyRouteWithoutRouteModule ? ',' : '' %><% if (lazyRouteWithoutRouteModule) { %>
14
+ CommonModule<% } %><% if (routing || lazyRouteWithRouteModule) { %>,
15
+ <%= classify(name) %>RoutingModule<% } %><% if (lazyRouteWithoutRouteModule) { %>,
16
16
RouterModule.forChild(routes)<% } %>
17
17
]
18
18
})
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ export default function (options: ModuleOptions): Rule {
139
139
}
140
140
141
141
let routingModulePath : Path | undefined ;
142
- const isLazyLoadedModuleGen = options . route && options . module ;
142
+ const isLazyLoadedModuleGen = ! ! ( options . route && options . module ) ;
143
143
if ( isLazyLoadedModuleGen ) {
144
144
options . routingScope = RoutingScope . Child ;
145
145
routingModulePath = getRoutingModulePath ( host , options . module as string ) ;
@@ -150,15 +150,15 @@ export default function (options: ModuleOptions): Rule {
150
150
options . path = parsedPath . path ;
151
151
152
152
const templateSource = apply ( url ( './files' ) , [
153
- options . routing || isLazyLoadedModuleGen && ! ! routingModulePath
153
+ options . routing || ( isLazyLoadedModuleGen && routingModulePath )
154
154
? noop ( )
155
155
: filter ( path => ! path . endsWith ( '-routing.module.ts.template' ) ) ,
156
156
applyTemplates ( {
157
157
...strings ,
158
158
'if-flat' : ( s : string ) => options . flat ? '' : s ,
159
159
lazyRoute : isLazyLoadedModuleGen ,
160
160
lazyRouteWithoutRouteModule : isLazyLoadedModuleGen && ! routingModulePath ,
161
- lazyRouteWithRouteModule : isLazyLoadedModuleGen && routingModulePath ,
161
+ lazyRouteWithRouteModule : isLazyLoadedModuleGen && ! ! routingModulePath ,
162
162
...options ,
163
163
} ) ,
164
164
move ( parsedPath . path ) ,
You can’t perform that action at this time.
0 commit comments