mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 13:03:04 +00:00
functional base href from ui config namespace property
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CommonModule, APP_BASE_HREF } from '@angular/common';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { RouterModule } from '@angular/router';
|
||||
@@ -39,7 +39,11 @@ export function getConfig() {
|
||||
return ENV_CONFIG;
|
||||
}
|
||||
|
||||
export function getMetaReducers(config: GlobalConfig): MetaReducer<AppState>[] {
|
||||
export function getBase() {
|
||||
return ENV_CONFIG.ui.nameSpace;
|
||||
}
|
||||
|
||||
export function getMetaReducers(config: GlobalConfig): Array<MetaReducer<AppState>> {
|
||||
return config.production ? appMetaReducers : [...appMetaReducers, storeFreeze];
|
||||
}
|
||||
|
||||
@@ -63,6 +67,10 @@ export function getMetaReducers(config: GlobalConfig): MetaReducer<AppState>[] {
|
||||
provide: GLOBAL_CONFIG,
|
||||
useFactory: (getConfig)
|
||||
},
|
||||
{
|
||||
provide: APP_BASE_HREF,
|
||||
useFactory: (getBase)
|
||||
},
|
||||
{
|
||||
provide: META_REDUCERS,
|
||||
useFactory: getMetaReducers,
|
||||
|
Reference in New Issue
Block a user