diff --git a/.gitignore b/.gitignore index 206050f57..176303f79 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ node_modules # IDEs /.idea /.vscode +/*.iml # misc .DS_Store diff --git a/src/lib/module.ts b/src/lib/module.ts index f413ecc70..063b3433b 100644 --- a/src/lib/module.ts +++ b/src/lib/module.ts @@ -41,28 +41,18 @@ export class FlexLayoutModule { * which sets the corresponding tokens accordingly */ static withConfig(configOptions: LayoutConfigOptions, - breakpoints?: BreakPoint|BreakPoint[]): ModuleWithProviders { + breakpoints: BreakPoint|BreakPoint[] = []): ModuleWithProviders { return { ngModule: FlexLayoutModule, - providers: Array.isArray(breakpoints) ? - configOptions.serverLoaded ? - [ - {provide: LAYOUT_CONFIG, useValue: configOptions}, - {provide: BREAKPOINT, useValue: breakpoints, multi: true}, - {provide: SERVER_TOKEN, useValue: true}, - ] : [ - {provide: LAYOUT_CONFIG, useValue: configOptions}, - {provide: BREAKPOINT, useValue: breakpoints, multi: true}, - ] - : - configOptions.serverLoaded ? - [ - {provide: LAYOUT_CONFIG, useValue: configOptions}, - {provide: SERVER_TOKEN, useValue: true}, - ] : - [ - {provide: LAYOUT_CONFIG, useValue: configOptions}, - ] + providers: configOptions.serverLoaded ? + [ + {provide: LAYOUT_CONFIG, useValue: configOptions}, + {provide: BREAKPOINT, useValue: breakpoints, multi: true}, + {provide: SERVER_TOKEN, useValue: true}, + ] : [ + {provide: LAYOUT_CONFIG, useValue: configOptions}, + {provide: BREAKPOINT, useValue: breakpoints, multi: true}, + ] }; }