mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
provide APP_ID instead of BrowserModule.withServerTransition, remove BrowserModule import
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { APP_BASE_HREF, CommonModule, DOCUMENT } from '@angular/common';
|
import { APP_BASE_HREF, CommonModule, DOCUMENT } from '@angular/common';
|
||||||
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
|
||||||
import { NgModule } from '@angular/core';
|
import { APP_ID, NgModule } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
|
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
@@ -124,13 +123,13 @@ const PROVIDERS = [
|
|||||||
AppComponent,
|
AppComponent,
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule.withServerTransition({appId: 'dspace-angular'}),
|
|
||||||
...IMPORTS,
|
...IMPORTS,
|
||||||
NgxMaskModule.forRoot(),
|
NgxMaskModule.forRoot(),
|
||||||
ThemedRootComponent
|
ThemedRootComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...PROVIDERS,
|
...PROVIDERS,
|
||||||
|
{provide: APP_ID, useValue: 'dspace-angular'},
|
||||||
provideCore(),
|
provideCore(),
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||||
import { NgModule } from '@angular/core';
|
import { APP_ID, NgModule } from '@angular/core';
|
||||||
import { BrowserModule, BrowserTransferStateModule, makeStateKey, TransferState } from '@angular/platform-browser';
|
import { makeStateKey, TransferState } from '@angular/platform-browser';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { REQUEST } from '@nguniversal/express-engine/tokens';
|
import { REQUEST } from '@nguniversal/express-engine/tokens';
|
||||||
|
|
||||||
@@ -53,9 +53,6 @@ export function getRequest(transferState: TransferState): any {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule.withServerTransition({
|
|
||||||
appId: 'dspace-angular'
|
|
||||||
}),
|
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
// forRoot ensures the providers are only created once
|
// forRoot ensures the providers are only created once
|
||||||
IdlePreloadModule.forRoot(),
|
IdlePreloadModule.forRoot(),
|
||||||
@@ -64,7 +61,6 @@ export function getRequest(transferState: TransferState): any {
|
|||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig<CoreState, Action>),
|
StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig<CoreState, Action>),
|
||||||
EffectsModule.forFeature(coreEffects),
|
EffectsModule.forFeature(coreEffects),
|
||||||
BrowserTransferStateModule,
|
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
@@ -76,6 +72,7 @@ export function getRequest(transferState: TransferState): any {
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...BrowserInitService.providers(),
|
...BrowserInitService.providers(),
|
||||||
|
{provide: APP_ID, useValue: 'dspace-angular'},
|
||||||
{
|
{
|
||||||
provide: REQUEST,
|
provide: REQUEST,
|
||||||
useFactory: getRequest,
|
useFactory: getRequest,
|
||||||
|
@@ -1,16 +1,12 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||||
import { NgModule } from '@angular/core';
|
import { APP_ID, NgModule } from '@angular/core';
|
||||||
import { BrowserModule, TransferState } from '@angular/platform-browser';
|
import { TransferState } from '@angular/platform-browser';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { ServerModule, ServerTransferStateModule } from '@angular/platform-server';
|
import { ServerModule, ServerTransferStateModule } from '@angular/platform-server';
|
||||||
|
|
||||||
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import {
|
import { Angulartics2, Angulartics2GoogleAnalytics, Angulartics2GoogleGlobalSiteTag } from 'angulartics2';
|
||||||
Angulartics2,
|
|
||||||
Angulartics2GoogleAnalytics,
|
|
||||||
Angulartics2GoogleGlobalSiteTag
|
|
||||||
} from 'angulartics2';
|
|
||||||
|
|
||||||
import { AppComponent } from '../../app/app.component';
|
import { AppComponent } from '../../app/app.component';
|
||||||
|
|
||||||
@@ -51,9 +47,6 @@ export function createTranslateLoader(transferState: TransferState) {
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule.withServerTransition({
|
|
||||||
appId: 'dspace-angular'
|
|
||||||
}),
|
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
ServerTransferStateModule,
|
ServerTransferStateModule,
|
||||||
StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig<CoreState, Action>),
|
StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig<CoreState, Action>),
|
||||||
@@ -70,6 +63,7 @@ export function createTranslateLoader(transferState: TransferState) {
|
|||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...ServerInitService.providers(),
|
...ServerInitService.providers(),
|
||||||
|
{provide: APP_ID, useValue: 'dspace-angular'},
|
||||||
{
|
{
|
||||||
provide: Angulartics2,
|
provide: Angulartics2,
|
||||||
useClass: Angulartics2Mock
|
useClass: Angulartics2Mock
|
||||||
|
Reference in New Issue
Block a user