mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Working on config providor.
This commit is contained in:
@@ -21,7 +21,7 @@ import { HostWindowState } from "./shared/host-window.reducer";
|
||||
import { HostWindowResizeAction } from "./shared/host-window.actions";
|
||||
import { MockTranslateLoader } from "./shared/testing/mock-translate-loader";
|
||||
|
||||
import { globalConfig } from '../config';
|
||||
import { GLOBAL_CONFIG, config } from '../config';
|
||||
|
||||
let comp: AppComponent;
|
||||
let fixture: ComponentFixture<AppComponent>;
|
||||
@@ -39,8 +39,8 @@ describe('App component', () => {
|
||||
})],
|
||||
declarations: [AppComponent], // declare the test component
|
||||
providers: [
|
||||
AppComponent,
|
||||
globalConfig
|
||||
{ provide: GLOBAL_CONFIG, useValue: config },
|
||||
AppComponent
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
|
@@ -11,7 +11,7 @@ import { HostWindowState } from "./shared/host-window.reducer";
|
||||
import { Store } from "@ngrx/store";
|
||||
import { HostWindowResizeAction } from "./shared/host-window.actions";
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig, globalConfig } from '../config';
|
||||
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||
|
||||
@Component({
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
|
@@ -9,7 +9,7 @@ import { Actions, Effect } from "@ngrx/effects";
|
||||
import { RequestCacheFindAllAction, RequestCacheFindByIDAction } from "../cache/request-cache.actions";
|
||||
import { CollectionDataService } from "./collection-data.service";
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig, globalConfig } from '../../../config';
|
||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../config';
|
||||
|
||||
@Injectable()
|
||||
export class CollectionDataEffects extends DataEffects<Collection> {
|
||||
|
@@ -9,7 +9,7 @@ import { Actions, Effect } from "@ngrx/effects";
|
||||
import { RequestCacheFindAllAction, RequestCacheFindByIDAction } from "../cache/request-cache.actions";
|
||||
import { ItemDataService } from "./item-data.service";
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig, globalConfig } from '../../../config';
|
||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../config';
|
||||
|
||||
@Injectable()
|
||||
export class ItemDataEffects extends DataEffects<Item> {
|
||||
|
@@ -3,7 +3,7 @@ import { Http, RequestOptionsArgs } from '@angular/http';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { RESTURLCombiner } from "../url-combiner/rest-url-combiner";
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig, globalConfig } from '../../../config';
|
||||
import { GLOBAL_CONFIG, GlobalConfig } from '../../../config';
|
||||
|
||||
/**
|
||||
* Service to access DSpace's REST API
|
||||
|
@@ -67,9 +67,4 @@ for (let key in config) {
|
||||
}
|
||||
}
|
||||
|
||||
const globalConfig = {
|
||||
provide: GLOBAL_CONFIG,
|
||||
useValue: config
|
||||
};
|
||||
|
||||
export { GLOBAL_CONFIG, GlobalConfig, globalConfig, config }
|
||||
export { GLOBAL_CONFIG, GlobalConfig, config }
|
||||
|
@@ -23,7 +23,7 @@ import { effects } from '../../app/app.effects';
|
||||
import { Meta } from '../angular2-meta';
|
||||
import { RehydrateStoreAction } from "../../app/store.actions";
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig, globalConfig } from '../../config';
|
||||
import { GLOBAL_CONFIG, config } from '../../config';
|
||||
|
||||
// import * as LRU from 'modern-lru';
|
||||
|
||||
@@ -72,6 +72,7 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
|
||||
effects
|
||||
],
|
||||
providers: [
|
||||
{ provide: GLOBAL_CONFIG, useValue: config },
|
||||
{ provide: 'isBrowser', useValue: isBrowser },
|
||||
{ provide: 'isNode', useValue: isNode },
|
||||
|
||||
@@ -80,9 +81,7 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
|
||||
|
||||
{ provide: 'LRU', useFactory: getLRU, deps: [] },
|
||||
|
||||
Meta,
|
||||
|
||||
globalConfig
|
||||
Meta
|
||||
|
||||
// { provide: AUTO_PREBOOT, useValue: false } // turn off auto preboot complete
|
||||
]
|
||||
|
@@ -21,7 +21,7 @@ import { effects } from '../../app/app.effects';
|
||||
// see https://github.com/angular/angular/pull/12322
|
||||
import { Meta } from '../angular2-meta';
|
||||
|
||||
import { globalConfig } from '../../config';
|
||||
import { GLOBAL_CONFIG, config } from '../../config';
|
||||
|
||||
export function createTranslateLoader(http: Http) {
|
||||
return new TranslateStaticLoader(http, './assets/i18n', '.json');
|
||||
@@ -63,6 +63,8 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
|
||||
effects
|
||||
],
|
||||
providers: [
|
||||
{ provide: GLOBAL_CONFIG, useValue: config },
|
||||
{ provide: 'res', useFactory: getResponse },
|
||||
{ provide: 'isBrowser', useValue: isBrowser },
|
||||
{ provide: 'isNode', useValue: isNode },
|
||||
|
||||
@@ -71,9 +73,8 @@ export const UNIVERSAL_KEY = 'UNIVERSAL_CACHE';
|
||||
|
||||
{ provide: 'LRU', useFactory: getLRU, deps: [] },
|
||||
|
||||
Meta,
|
||||
Meta
|
||||
|
||||
globalConfig
|
||||
]
|
||||
})
|
||||
export class MainModule {
|
||||
|
Reference in New Issue
Block a user