-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allows use in lazy loaded modules
The new 'providedIn' syntax does not work for EventPlugins, which still get registered in the module. Therefore, the 'forRoot' syntax is required to enforce the provider being registered in the root only
- Loading branch information
Showing
12 changed files
with
120 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
import { HttpClientModule } from '@angular/common/http'; | ||
import { NgModule } from '@angular/core'; | ||
import { FlexLayoutModule } from '@angular/flex-layout'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { | ||
MatButtonModule, MatCardModule, MatCheckboxModule, MatIconModule, | ||
MatInputModule, MatMenuModule, MatSelectModule, MatToolbarModule | ||
} from '@angular/material'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { AceEditorModule } from 'ng2-ace-editor'; | ||
|
||
import { JsonSchemaFormModule } from '../../../ngx-json-schema-form/src/public-api'; | ||
|
||
import { AppComponent } from './app.component'; | ||
import { routes } from './app.routes'; | ||
import { RootComponent } from './root.component'; | ||
|
||
@NgModule({ | ||
bootstrap: [ RootComponent ], | ||
declarations: [ | ||
AppComponent, | ||
RootComponent | ||
], | ||
imports: [ | ||
BrowserModule, BrowserAnimationsModule, FormsModule, HttpClientModule, FlexLayoutModule, | ||
MatButtonModule, MatCardModule, MatCheckboxModule, MatIconModule, | ||
MatInputModule, MatMenuModule, MatSelectModule, MatToolbarModule, | ||
RouterModule.forRoot(routes), | ||
BrowserModule, BrowserAnimationsModule, HttpClientModule, | ||
|
||
AceEditorModule, | ||
RouterModule.forRoot(routes), | ||
|
||
JsonSchemaFormModule | ||
JsonSchemaFormModule.forRoot() | ||
] | ||
}) | ||
export class AppModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import { Route } from '@angular/router'; | ||
|
||
import { AppComponent } from './app.component'; | ||
|
||
export const routes: Array<Route> = [ | ||
{ path: '', component: AppComponent }, | ||
{ path: '**', component: AppComponent } | ||
{ | ||
loadChildren: './demo/demo.module#DemoModule', | ||
path: '' | ||
}, | ||
{ | ||
loadChildren: './demo/demo.module#DemoModule', | ||
path: '**' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { routes } from './demo.routes'; | ||
|
||
@NgModule({ | ||
exports: [ RouterModule ], | ||
imports: [ RouterModule.forChild(routes) ] | ||
}) | ||
export class DemoRoutingModule { } |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { FlexLayoutModule } from '@angular/flex-layout'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { | ||
MatButtonModule, MatCardModule, MatCheckboxModule, MatIconModule, | ||
MatInputModule, MatMenuModule, MatSelectModule, MatToolbarModule | ||
} from '@angular/material'; | ||
|
||
import { AceEditorModule } from 'ng2-ace-editor'; | ||
|
||
import { JsonSchemaFormModule } from '../../../../ngx-json-schema-form/src/public-api'; | ||
|
||
import { DemoRoutingModule } from './demo-routing.module'; | ||
import { DemoComponent } from './demo.component'; | ||
|
||
@NgModule({ | ||
declarations: [ DemoComponent ], | ||
imports: [ | ||
CommonModule, | ||
DemoRoutingModule, | ||
FormsModule, FlexLayoutModule, | ||
|
||
MatButtonModule, MatCardModule, MatCheckboxModule, MatIconModule, | ||
MatInputModule, MatMenuModule, MatSelectModule, MatToolbarModule, | ||
|
||
AceEditorModule, | ||
|
||
JsonSchemaFormModule | ||
] | ||
}) | ||
export class DemoModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Routes } from '@angular/router'; | ||
|
||
import { DemoComponent } from './demo.component'; | ||
|
||
export const routes: Routes = [ | ||
{ | ||
component: DemoComponent, | ||
path: '' | ||
}, | ||
{ | ||
component: DemoComponent, | ||
path: '**' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters