File tree Expand file tree Collapse file tree 3 files changed +64
-1
lines changed Expand file tree Collapse file tree 3 files changed +64
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { PreloadAllModules , RouterModule , Routes } from '@angular/router' ;
2
+ import { NgModule } from '@angular/core' ;
3
+
4
+ const routes : Routes = [ ] ;
5
+
6
+ @NgModule ( {
7
+ imports : [
8
+ RouterModule . forRoot ( routes , {
9
+ scrollPositionRestoration : 'enabled' ,
10
+ preloadingStrategy : PreloadAllModules ,
11
+ } ) ,
12
+ ] ,
13
+ exports : [ RouterModule ] ,
14
+ } )
15
+ export class AppRoutingModule { }
Original file line number Diff line number Diff line change @@ -4,15 +4,26 @@ import { BrowserModule } from '@angular/platform-browser';
4
4
import { NgModule } from '@angular/core' ;
5
5
6
6
import { AppComponent } from './app/app.component' ;
7
+ import { AppRoutingModule } from './app-routing.module' ;
8
+ import { CoreModule } from './core/core.module' ;
7
9
8
10
@NgModule ( {
9
11
declarations : [ AppComponent ] ,
10
12
imports : [
13
+ // Angular
11
14
BrowserModule ,
12
- TuiRootModule ,
13
15
BrowserAnimationsModule ,
16
+
17
+ // Taiga UI
18
+ TuiRootModule ,
14
19
TuiDialogModule ,
15
20
TuiNotificationsModule ,
21
+
22
+ // Core
23
+ CoreModule ,
24
+
25
+ // Routing
26
+ AppRoutingModule ,
16
27
] ,
17
28
providers : [ ] ,
18
29
bootstrap : [ AppComponent ] ,
Original file line number Diff line number Diff line change
1
+ import { NgModule , Optional , SkipSelf } from '@angular/core' ;
2
+ import { CommonModule } from '@angular/common' ;
3
+ import { EffectsModule } from '@ngrx/effects' ;
4
+ import { HttpClientModule } from '@angular/common/http' ;
5
+ import { StoreDevtoolsModule } from '@ngrx/store-devtools' ;
6
+ import { StoreModule } from '@ngrx/store' ;
7
+ import { StoreRouterConnectingModule } from '@ngrx/router-store' ;
8
+
9
+ import { environment } from '../../environments/environment' ;
10
+
11
+ @NgModule ( {
12
+ imports : [
13
+ // Angular
14
+ CommonModule ,
15
+ HttpClientModule ,
16
+
17
+ // NgRx
18
+ StoreModule . forRoot ( { } , { } ) ,
19
+ StoreRouterConnectingModule . forRoot ( ) ,
20
+ EffectsModule . forRoot ( [ ] ) ,
21
+ environment . production
22
+ ? [ ]
23
+ : StoreDevtoolsModule . instrument ( { name : 'Angular Authentication' } ) ,
24
+ ] ,
25
+ exports : [ ] ,
26
+ } )
27
+ export class CoreModule {
28
+ constructor (
29
+ @Optional ( )
30
+ @SkipSelf ( )
31
+ parentModule : CoreModule
32
+ ) {
33
+ if ( parentModule ) {
34
+ throw new Error ( 'CoreModule is already loaded. Import only once in AppModule' ) ;
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments