|
|
@@ -1,41 +1,23 @@
|
|
|
-import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
|
|
import { NgModule } from '@angular/core';
|
|
|
-import { Apollo, APOLLO_OPTIONS, ApolloModule } from 'apollo-angular';
|
|
|
-import { HttpLink, HttpLinkModule } from 'apollo-angular-link-http';
|
|
|
-import { InMemoryCache } from 'apollo-cache-inmemory';
|
|
|
-
|
|
|
-import { API_PATH } from '../../../../shared/shared-constants';
|
|
|
-import { API_URL } from '../app.config';
|
|
|
import { SharedModule } from '../shared/shared.module';
|
|
|
-import { APOLLO_NGRX_CACHE, StateModule } from '../state/state.module';
|
|
|
+import { StateModule } from '../state/state.module';
|
|
|
|
|
|
+import { DataModule } from '../data/data.module';
|
|
|
import { AppShellComponent } from './components/app-shell/app-shell.component';
|
|
|
import { BreadcrumbComponent } from './components/breadcrumb/breadcrumb.component';
|
|
|
import { MainNavComponent } from './components/main-nav/main-nav.component';
|
|
|
import { NotificationComponent } from './components/notification/notification.component';
|
|
|
import { OverlayHostComponent } from './components/overlay-host/overlay-host.component';
|
|
|
import { UserMenuComponent } from './components/user-menu/user-menu.component';
|
|
|
-import { BaseDataService } from './providers/data/base-data.service';
|
|
|
-import { DataService } from './providers/data/data.service';
|
|
|
-import { DefaultInterceptor } from './providers/data/interceptor';
|
|
|
import { AuthGuard } from './providers/guard/auth.guard';
|
|
|
import { LocalStorageService } from './providers/local-storage/local-storage.service';
|
|
|
import { NotificationService } from './providers/notification/notification.service';
|
|
|
import { OverlayHostService } from './providers/overlay-host/overlay-host.service';
|
|
|
|
|
|
-export function createApollo(httpLink: HttpLink, ngrxCache: InMemoryCache) {
|
|
|
- return {
|
|
|
- link: httpLink.create({ uri: `${API_URL}/${API_PATH}` }),
|
|
|
- cache: ngrxCache,
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
@NgModule({
|
|
|
imports: [
|
|
|
+ DataModule,
|
|
|
SharedModule,
|
|
|
- HttpClientModule,
|
|
|
- ApolloModule,
|
|
|
- HttpLinkModule,
|
|
|
StateModule,
|
|
|
],
|
|
|
exports: [
|
|
|
@@ -43,15 +25,7 @@ export function createApollo(httpLink: HttpLink, ngrxCache: InMemoryCache) {
|
|
|
OverlayHostComponent,
|
|
|
],
|
|
|
providers: [
|
|
|
- {
|
|
|
- provide: APOLLO_OPTIONS,
|
|
|
- useFactory: createApollo,
|
|
|
- deps: [HttpLink, APOLLO_NGRX_CACHE],
|
|
|
- },
|
|
|
- { provide: HTTP_INTERCEPTORS, useClass: DefaultInterceptor, multi: true },
|
|
|
- BaseDataService,
|
|
|
LocalStorageService,
|
|
|
- DataService,
|
|
|
AuthGuard,
|
|
|
OverlayHostService,
|
|
|
NotificationService,
|