-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
/
Copy pathapp.module.ts
78 lines (72 loc) · 2.2 KB
/
app.module.ts
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule, PreloadAllModules } from '@angular/router';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
/*
* Platform and Environment providers/directives/pipes
*/
import { environment } from 'environments/environment';
import { ROUTES } from './app.routes';
// App is our top level component
import { AppComponent } from './app.component';
import { APP_RESOLVER_PROVIDERS } from './app.resolver';
import { AppState, InternalStateType } from './app.service';
import { HomeComponent } from './home';
import { AboutComponent } from './about';
import { NoContentComponent } from './no-content';
import { XLargeDirective } from './home/x-large';
import { DevModuleModule } from './+dev-module';
import '../styles/styles.scss';
import '../styles/headings.css';
// Application wide providers
const APP_PROVIDERS = [
...APP_RESOLVER_PROVIDERS,
AppState
];
interface StoreType {
state: InternalStateType;
restoreInputValues: () => void;
disposeOldHosts: () => void;
}
/**
* `AppModule` is the main entry point into Angular2's bootstraping process
*/
@NgModule({
bootstrap: [ AppComponent ],
declarations: [
AppComponent,
AboutComponent,
HomeComponent,
NoContentComponent,
XLargeDirective
],
/**
* Import Angular's modules.
*/
imports: [
BrowserModule,
BrowserAnimationsModule,
FormsModule,
HttpClientModule,
RouterModule.forRoot(ROUTES, {
useHash: Boolean(history.pushState) === false,
preloadingStrategy: PreloadAllModules
}),
/**
* This section will import the `DevModuleModule` only in certain build types.
* When the module is not imported it will get tree shaked.
* This is a simple example, a big app should probably implement some logic
*/
...environment.showDevModule ? [ DevModuleModule ] : [],
],
/**
* Expose our Services and Providers into Angular's dependency injection.
*/
providers: [
environment.ENV_PROVIDERS,
APP_PROVIDERS
]
})
export class AppModule {}