File tree Expand file tree Collapse file tree 6 files changed +64
-31
lines changed
material-design-framework Expand file tree Collapse file tree 6 files changed +64
-31
lines changed Original file line number Diff line number Diff line change 1
- import { NgModule } from '@angular/core' ;
1
+ import { NgModule , ModuleWithProviders } from '@angular/core' ;
2
2
import { CommonModule } from '@angular/common' ;
3
3
4
4
import { WidgetLibraryModule } from '../../widget-library/widget-library.module' ;
5
5
6
- import { WidgetLibraryService } from '../../widget-library/widget-library.service' ;
7
- import { FrameworkLibraryService } from '../framework-library.service' ;
6
+ import { JsonSchemaFormService } from '../../json-schema-form.service' ;
8
7
9
8
import { Bootstrap3FrameworkComponent } from './bootstrap-3-framework.component' ;
10
9
11
10
@NgModule ( {
12
11
imports : [ CommonModule , WidgetLibraryModule ] ,
13
12
declarations : [ Bootstrap3FrameworkComponent ] ,
14
13
exports : [ Bootstrap3FrameworkComponent ] ,
15
- entryComponents : [ Bootstrap3FrameworkComponent ] ,
16
- providers : [ WidgetLibraryService , FrameworkLibraryService ]
14
+ entryComponents : [ Bootstrap3FrameworkComponent ]
17
15
} )
18
- export class Bootstrap3FrameworkModule { }
16
+ export class Bootstrap3FrameworkModule {
17
+ static forRoot ( ) : ModuleWithProviders {
18
+ return {
19
+ ngModule : Bootstrap3FrameworkModule ,
20
+ providers : [ JsonSchemaFormService ]
21
+ }
22
+ }
23
+ }
Original file line number Diff line number Diff line change 1
- import { NgModule } from '@angular/core' ;
1
+ import { NgModule , ModuleWithProviders } from '@angular/core' ;
2
2
import { CommonModule } from '@angular/common' ;
3
3
4
4
import { WidgetLibraryModule } from '../../widget-library/widget-library.module' ;
5
5
6
- import { WidgetLibraryService } from '../../widget-library/widget-library.service' ;
7
- import { FrameworkLibraryService } from '../framework-library.service' ;
6
+ import { JsonSchemaFormService } from '../../json-schema-form.service' ;
8
7
9
8
import { Bootstrap4FrameworkComponent } from './bootstrap-4-framework.component' ;
10
9
11
10
@NgModule ( {
12
11
imports : [ CommonModule , WidgetLibraryModule ] ,
13
12
declarations : [ Bootstrap4FrameworkComponent ] ,
14
13
exports : [ Bootstrap4FrameworkComponent ] ,
15
- entryComponents : [ Bootstrap4FrameworkComponent ] ,
16
- providers : [ WidgetLibraryService , FrameworkLibraryService ]
14
+ entryComponents : [ Bootstrap4FrameworkComponent ]
17
15
} )
18
- export class Bootstrap4FrameworkModule { }
16
+ export class Bootstrap4FrameworkModule {
17
+ static forRoot ( ) : ModuleWithProviders {
18
+ return {
19
+ ngModule : Bootstrap4FrameworkModule ,
20
+ providers : [ JsonSchemaFormService ]
21
+ }
22
+ }
23
+ }
Original file line number Diff line number Diff line change 1
- import { NgModule } from '@angular/core' ;
1
+ import { NgModule , ModuleWithProviders } from '@angular/core' ;
2
2
import { CommonModule } from '@angular/common' ;
3
3
4
- import { WidgetLibraryModule } from '../widget-library/widget-library.module' ;
5
4
import { WidgetLibraryService } from '../widget-library/widget-library.service' ;
5
+ import { WidgetLibraryModule } from '../widget-library/widget-library.module' ;
6
6
7
7
import { FrameworkLibraryService } from './framework-library.service' ;
8
8
import { NoFrameworkComponent } from './no-framework.component' ;
@@ -15,7 +15,13 @@ import { NoFrameworkComponent } from './no-framework.component';
15
15
exports : [
16
16
NoFrameworkComponent ,
17
17
] ,
18
- entryComponents : [ NoFrameworkComponent ] ,
19
- providers : [ WidgetLibraryService , FrameworkLibraryService ]
18
+ entryComponents : [ NoFrameworkComponent ]
20
19
} )
21
- export class FrameworkLibraryModule { }
20
+ export class FrameworkLibraryModule {
21
+ static forRoot ( ) : ModuleWithProviders {
22
+ return {
23
+ ngModule : FrameworkLibraryModule ,
24
+ providers : [ WidgetLibraryService , FrameworkLibraryService ]
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change 1
- import { NgModule } from '@angular/core' ;
1
+ import { NgModule , ModuleWithProviders } from '@angular/core' ;
2
2
import { CommonModule } from '@angular/common' ;
3
3
import { FormsModule , ReactiveFormsModule } from '@angular/forms' ;
4
4
import { FlexLayoutModule } from '@angular/flex-layout' ;
@@ -36,7 +36,13 @@ import { MATERIAL_FRAMEWORK_COMPONENTS } from './index';
36
36
] ,
37
37
declarations : [ ...MATERIAL_FRAMEWORK_COMPONENTS ] ,
38
38
exports : [ ...MATERIAL_FRAMEWORK_COMPONENTS ] ,
39
- entryComponents : [ ...MATERIAL_FRAMEWORK_COMPONENTS ] ,
40
- providers : [ JsonSchemaFormService ]
39
+ entryComponents : [ ...MATERIAL_FRAMEWORK_COMPONENTS ]
41
40
} )
42
- export class MaterialDesignFrameworkModule { }
41
+ export class MaterialDesignFrameworkModule {
42
+ static forRoot ( ) : ModuleWithProviders {
43
+ return {
44
+ ngModule : MaterialDesignFrameworkModule ,
45
+ providers : [ JsonSchemaFormService ]
46
+ }
47
+ }
48
+ }
Original file line number Diff line number Diff line change 1
- import { NgModule } from '@angular/core' ;
1
+ import { NgModule , ModuleWithProviders } from '@angular/core' ;
2
2
import { CommonModule } from '@angular/common' ;
3
3
import { FormsModule , ReactiveFormsModule } from '@angular/forms' ;
4
4
@@ -8,7 +8,6 @@ import { WidgetLibraryModule } from './widget-library/widget-library.module';
8
8
import { JsonSchemaFormComponent } from './json-schema-form.component' ;
9
9
10
10
import { JsonSchemaFormService } from './json-schema-form.service' ;
11
- import { FrameworkLibraryService } from './framework-library/framework-library.service' ;
12
11
13
12
@NgModule ( {
14
13
imports : [
@@ -18,9 +17,15 @@ import { FrameworkLibraryService } from './framework-library/framework-library.s
18
17
declarations : [ JsonSchemaFormComponent ] ,
19
18
exports : [
20
19
JsonSchemaFormComponent , FrameworkLibraryModule , WidgetLibraryModule
21
- ] ,
22
- providers : [
23
- JsonSchemaFormService , FrameworkLibraryService
24
20
]
25
21
} )
26
- export class JsonSchemaFormModule { }
22
+ export class JsonSchemaFormModule {
23
+ static forRoot ( ) : ModuleWithProviders {
24
+ return {
25
+ ngModule : JsonSchemaFormModule ,
26
+ providers : [ ]
27
+ . concat ( [ JsonSchemaFormService ] )
28
+ . concat ( FrameworkLibraryModule . forRoot ( ) . providers )
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change 1
- import { NgModule } from '@angular/core' ;
1
+ import { NgModule , ModuleWithProviders } from '@angular/core' ;
2
2
import { CommonModule } from '@angular/common' ;
3
3
import { FormsModule , ReactiveFormsModule } from '@angular/forms' ;
4
4
5
5
import { OrderableDirective } from '../shared/orderable.directive' ;
6
6
7
- import { WidgetLibraryService } from './widget-library.service' ;
8
7
import { JsonSchemaFormService } from '../json-schema-form.service' ;
9
8
10
9
import { BASIC_WIDGETS } from './index' ;
@@ -14,6 +13,13 @@ import { BASIC_WIDGETS } from './index';
14
13
declarations : [ ...BASIC_WIDGETS , OrderableDirective ] ,
15
14
exports : [ ...BASIC_WIDGETS , OrderableDirective ] ,
16
15
entryComponents : [ ...BASIC_WIDGETS ] ,
17
- providers : [ JsonSchemaFormService , WidgetLibraryService ]
16
+ providers : [ JsonSchemaFormService ]
18
17
} )
19
- export class WidgetLibraryModule { }
18
+ export class WidgetLibraryModule {
19
+ static forRoot ( ) : ModuleWithProviders {
20
+ return {
21
+ ngModule : WidgetLibraryModule ,
22
+ providers : [ JsonSchemaFormService ]
23
+ }
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments