@@ -4,10 +4,14 @@ import { hydrateRequest, hydrateTabRequest, getNgModules, GeneratorOption, Gener
4
4
5
5
export { getNgModules , GeneratorOption , GeneratorRequest } ;
6
6
7
- export function processPageRequest ( context : BuildContext , name : string , commandOptions : any ) {
8
-
9
- const hydratedRequest = hydrateRequest ( context , { type : 'page' , name, includeNgModule : commandOptions . module } ) ;
10
- return generateTemplates ( context , hydratedRequest , commandOptions . constants ) ;
7
+ export function processPageRequest ( context : BuildContext , name : string , commandOptions ?: { module ?: boolean ; constants ?: boolean ; } ) {
8
+ if ( commandOptions ) {
9
+ const hydratedRequest = hydrateRequest ( context , { type : 'page' , name, includeNgModule : commandOptions . module } ) ;
10
+ return generateTemplates ( context , hydratedRequest , commandOptions . constants ) ;
11
+ } else {
12
+ const hydratedRequest = hydrateRequest ( context , { type : 'page' , name, includeNgModule : false } ) ;
13
+ return generateTemplates ( context , hydratedRequest ) ;
14
+ }
11
15
}
12
16
13
17
export function processPipeRequest ( context : BuildContext , name : string , ngModulePath : string ) {
@@ -26,9 +30,11 @@ export function processProviderRequest(context: BuildContext, name: string, ngMo
26
30
return nonPageFileManipulation ( context , name , ngModulePath , 'provider' ) ;
27
31
}
28
32
29
- export function processTabsRequest ( context : BuildContext , name : string , tabs : any [ ] , commandOptions : any ) {
30
- const includePageConstants = commandOptions . constants ;
31
- const includeNgModule = commandOptions . module ;
33
+ export function processTabsRequest ( context : BuildContext , name : string , tabs : any [ ] , commandOptions ?: { module ?: boolean ; constants ?: boolean ; } ) {
34
+
35
+ const includePageConstants = commandOptions ? commandOptions . constants : false ;
36
+ const includeNgModule = commandOptions ? commandOptions . module : false ;
37
+
32
38
const tabHydratedRequests = tabs . map ( ( tab ) => hydrateRequest ( context , { type : 'page' , name : tab , includeNgModule} ) ) ;
33
39
const hydratedRequest = hydrateTabRequest ( context , { type : 'tabs' , name, includeNgModule, tabs : tabHydratedRequests } ) ;
34
40
0 commit comments