This repository was archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 754
Expand file tree
/
Copy pathmodule.ts
More file actions
49 lines (44 loc) · 1.36 KB
/
module.ts
File metadata and controls
49 lines (44 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ModuleWithProviders, NgModule} from '@angular/core';
import {BreakpointDirective, UnifiedDirective} from './src/unified';
import {FLEX_PROVIDER, GRID_PROVIDER, TAGS_PROVIDER} from './src/tags/tags';
import {BREAKPOINTS_PROVIDER} from './src/breakpoint';
@NgModule({
declarations: [UnifiedDirective, BreakpointDirective],
exports: [UnifiedDirective, BreakpointDirective]
})
export class UnifiedModule {
static withDefaults(withDefaultBp: boolean = true): ModuleWithProviders<UnifiedModule> {
return {
ngModule: UnifiedModule,
providers: withDefaultBp ? [
TAGS_PROVIDER,
BREAKPOINTS_PROVIDER,
] : [TAGS_PROVIDER],
};
}
static withFlex(withDefaultBp: boolean = true): ModuleWithProviders<UnifiedModule> {
return {
ngModule: UnifiedModule,
providers: withDefaultBp ? [
FLEX_PROVIDER,
BREAKPOINTS_PROVIDER
] : [FLEX_PROVIDER]
};
}
static withGrid(withDefaultBp: boolean = true): ModuleWithProviders<UnifiedModule> {
return {
ngModule: UnifiedModule,
providers: withDefaultBp ? [
GRID_PROVIDER,
BREAKPOINTS_PROVIDER
] : [GRID_PROVIDER]
};
}
}