forked from hazza/dspace-angular
93219: Support Router in InitService
For Router to work properly, APP_BASE_HREF must be resolved _before_ the APP_INITIALIZER factory is called (otherwise Angular will attempt to initialize APP_BASE_HREF too soon) To fix this we add a pre-initialization hook to APP_CONFIG so BrowserInitService can resolve it before APP_INITIALIZER
This commit is contained in:
@@ -30,7 +30,6 @@ import { ServerHardRedirectService } from '../../app/core/services/server-hard-r
|
||||
import { Angulartics2Mock } from '../../app/shared/mocks/angulartics2.service.mock';
|
||||
import { AuthRequestService } from '../../app/core/auth/auth-request.service';
|
||||
import { ServerAuthRequestService } from '../../app/core/auth/server-auth-request.service';
|
||||
import { InitService } from '../../app/init.service';
|
||||
import { ServerInitService } from './server-init.service';
|
||||
|
||||
export function createTranslateLoader(transferState: TransferState) {
|
||||
@@ -56,10 +55,7 @@ export function createTranslateLoader(transferState: TransferState) {
|
||||
AppModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: InitService,
|
||||
useClass: ServerInitService,
|
||||
},
|
||||
...ServerInitService.providers(),
|
||||
{
|
||||
provide: Angulartics2,
|
||||
useClass: Angulartics2Mock
|
||||
|
Reference in New Issue
Block a user