mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Avoid getting a separate instance of ServerResponseService for each PageNotFoundComponent
https://angular.io/guide/ngmodule-faq#should-i-add-other-providers-to-a-module-or-a-component
This commit is contained in:
@@ -5,7 +5,6 @@ import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|||||||
selector: 'ds-pagenotfound',
|
selector: 'ds-pagenotfound',
|
||||||
styleUrls: ['./pagenotfound.component.scss'],
|
styleUrls: ['./pagenotfound.component.scss'],
|
||||||
templateUrl: './pagenotfound.component.html',
|
templateUrl: './pagenotfound.component.html',
|
||||||
providers: [ServerResponseService],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class PageNotFoundComponent {
|
export class PageNotFoundComponent {
|
||||||
|
@@ -24,6 +24,7 @@ import { ItemListElementComponent } from '../object-list/item-list-element/item-
|
|||||||
import { CommunityListElementComponent } from '../object-list/community-list-element/community-list-element.component';
|
import { CommunityListElementComponent } from '../object-list/community-list-element/community-list-element.component';
|
||||||
import { CollectionListElementComponent } from '../object-list/collection-list-element/collection-list-element.component';
|
import { CollectionListElementComponent } from '../object-list/collection-list-element/collection-list-element.component';
|
||||||
import { TruncatePipe } from './utils/truncate.pipe';
|
import { TruncatePipe } from './utils/truncate.pipe';
|
||||||
|
import { ServerResponseService } from './server-response.service';
|
||||||
|
|
||||||
const MODULES = [
|
const MODULES = [
|
||||||
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
// Do NOT include UniversalModule, HttpModule, or JsonpModule here
|
||||||
@@ -61,7 +62,8 @@ const COMPONENTS = [
|
|||||||
const PROVIDERS = [
|
const PROVIDERS = [
|
||||||
ApiService,
|
ApiService,
|
||||||
HostWindowService,
|
HostWindowService,
|
||||||
{ provide: NativeWindowService, useFactory: NativeWindowFactory }
|
{ provide: NativeWindowService, useFactory: NativeWindowFactory },
|
||||||
|
ServerResponseService
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
Reference in New Issue
Block a user