File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ export class SampleAssetsGenerator {
317317 }
318318 } ) ;
319319 }
320- if ( appConfig . routesConfig ?. router && appConfig . routesConfig ?. routesImportPath ) {
320+ if ( this . _shouldConfigureRouting ( config ) ) {
321321 importMap . set ( '@angular/router' , [ 'provideRouter' , 'withComponentInputBinding' ] ) ;
322322 importMap . set ( `${ appConfig . routesConfig . routesImportPath } ` , [ 'routes' ] ) ;
323323 }
@@ -355,7 +355,7 @@ export class SampleAssetsGenerator {
355355 formatted += ` ${ provider } ${ i < providers . length - 1 ? ',\n' : '' } ` ;
356356 } ) ;
357357 }
358- if ( config . appConfig . routesConfig ?. router && config . appConfig . routesConfig ?. routesImportPath ) {
358+ if ( this . _shouldConfigureRouting ( config ) ) {
359359 if ( formatted . length > 0 ) {
360360 formatted += ',\n' ;
361361 }
@@ -364,6 +364,11 @@ export class SampleAssetsGenerator {
364364 return formatted ;
365365 }
366366
367+ private _shouldConfigureRouting ( config : Config ) : boolean {
368+ const routesConfig = config ?. appConfig ?. routesConfig ;
369+ return ! ! ( routesConfig ?. router && routesConfig ?. routesImportPath ) ;
370+ }
371+
367372 private _getAppModuleConfig ( config : Config , configImports , configAdditionalImports ?) {
368373 let defaultNgDeclarations = [ "AppComponent" ] ;
369374 let defaultNgImports = [ "BrowserModule" , "BrowserAnimationsModule" , "FormsModule" ] ;
You can’t perform that action at this time.
0 commit comments