Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 76c110e

Browse files
livthomasCaerusKaru
authored andcommitted
fix(module): do not require breakpoints in withConfig (#853)
Fixes #846
1 parent 5ddccb5 commit 76c110e

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ node_modules
1313
# IDEs
1414
/.idea
1515
/.vscode
16+
/*.iml
1617

1718
# misc
1819
.DS_Store

src/lib/module.ts

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,18 @@ export class FlexLayoutModule {
4141
* which sets the corresponding tokens accordingly
4242
*/
4343
static withConfig(configOptions: LayoutConfigOptions,
44-
breakpoints?: BreakPoint|BreakPoint[]): ModuleWithProviders {
44+
breakpoints: BreakPoint|BreakPoint[] = []): ModuleWithProviders {
4545
return {
4646
ngModule: FlexLayoutModule,
47-
providers: Array.isArray(breakpoints) ?
48-
configOptions.serverLoaded ?
49-
[
50-
{provide: LAYOUT_CONFIG, useValue: configOptions},
51-
{provide: BREAKPOINT, useValue: breakpoints, multi: true},
52-
{provide: SERVER_TOKEN, useValue: true},
53-
] : [
54-
{provide: LAYOUT_CONFIG, useValue: configOptions},
55-
{provide: BREAKPOINT, useValue: breakpoints, multi: true},
56-
]
57-
:
58-
configOptions.serverLoaded ?
59-
[
60-
{provide: LAYOUT_CONFIG, useValue: configOptions},
61-
{provide: SERVER_TOKEN, useValue: true},
62-
] :
63-
[
64-
{provide: LAYOUT_CONFIG, useValue: configOptions},
65-
]
47+
providers: configOptions.serverLoaded ?
48+
[
49+
{provide: LAYOUT_CONFIG, useValue: configOptions},
50+
{provide: BREAKPOINT, useValue: breakpoints, multi: true},
51+
{provide: SERVER_TOKEN, useValue: true},
52+
] : [
53+
{provide: LAYOUT_CONFIG, useValue: configOptions},
54+
{provide: BREAKPOINT, useValue: breakpoints, multi: true},
55+
]
6656
};
6757
}
6858

0 commit comments

Comments
 (0)