From: Jane Sandberg Date: Wed, 24 Jun 2020 06:29:37 +0000 (-0700) Subject: LP#1842297 - fix dependency injection issue in subclass component X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f887ba04308476b421f07e68a511d7e65bc0e309;p=working%2FEvergreen.git LP#1842297 - fix dependency injection issue in subclass component Injecting services into the subclass of an Angular Component is treacherous. Among other issues, the subclass needs to include a constructor that declares the same dependencies needed by the parent class, per https://angular.io/guide/dependency-injection-in-action#inject-into-a-derived-class Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.ts index 8ce84c092b..6c075b9eff 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/openathens-identity.component.ts @@ -1,5 +1,14 @@ import {Component, OnInit} from '@angular/core'; +import {Location} from '@angular/common'; +import {ActivatedRoute} from '@angular/router'; +import {FormatService} from '@eg/core/format.service'; import {AdminPageComponent} from '@eg/staff/share/admin-page/admin-page.component'; +import {IdlService, IdlObject} from '@eg/core/idl.service'; +import {PcrudService} from '@eg/core/pcrud.service'; +import {OrgService} from '@eg/core/org.service'; +import {PermService} from '@eg/core/perm.service'; +import {AuthService} from '@eg/core/auth.service'; +import {ToastService} from '@eg/share/toast/toast.service'; @Component({ templateUrl: './openathens-identity.component.html' @@ -9,6 +18,20 @@ export class OpenAthensIdentityComponent extends AdminPageComponent implements O idlClass = 'coai'; classLabel: string; + constructor( + route: ActivatedRoute, + ngLocation: Location, + format: FormatService, + idl: IdlService, + org: OrgService, + auth: AuthService, + pcrud: PcrudService, + perm: PermService, + toast: ToastService, + ) { + super(route, ngLocation, format, idl, org, auth, pcrud, perm, toast); + } + ngOnInit() { super.ngOnInit(); @@ -40,5 +63,9 @@ export class OpenAthensIdentityComponent extends AdminPageComponent implements O } } ); - }; -} \ No newline at end of file + } + + deleteSelected = (entries: IdlObject[]) => { + super.deleteSelected(entries); + } +}