Skip to content
Snippets Groups Projects
Verified Commit 378f487e authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-5977 replace constructor with inject

parent 0e74a414
No related branches found
No related tags found
1 merge request!74OZG-5977 add multi file upload to wiedervorlagen
...@@ -21,10 +21,9 @@ ...@@ -21,10 +21,9 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { KOMMENTAR_UPLOADED_ATTACHMENTS, KommentarLinkRel, KommentarListLinkRel } from '@alfa-client/kommentar-shared';
import { isNotNil, StateResource } from '@alfa-client/tech-shared'; import { isNotNil, StateResource } from '@alfa-client/tech-shared';
import { WIEDERVORLAGE_UPLOADED_ATTACHMENTS, WiedervorlageLinkRel, WiedervorlageListLinkRel, WiedervorlageListResource, WiedervorlageResource, } from '@alfa-client/wiedervorlage-shared'; import { WIEDERVORLAGE_UPLOADED_ATTACHMENTS, WiedervorlageLinkRel, WiedervorlageListLinkRel, WiedervorlageListResource, WiedervorlageResource, } from '@alfa-client/wiedervorlage-shared';
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core';
import { isNull } from 'lodash-es'; import { isNull } from 'lodash-es';
import { WiedervorlageFormService } from './wiedervorlage.formservice'; import { WiedervorlageFormService } from './wiedervorlage.formservice';
...@@ -38,13 +37,13 @@ export class WiedervorlageFormComponent implements OnChanges { ...@@ -38,13 +37,13 @@ export class WiedervorlageFormComponent implements OnChanges {
@Input() wiedervorlageListStateResource: StateResource<WiedervorlageListResource>; @Input() wiedervorlageListStateResource: StateResource<WiedervorlageListResource>;
@Input() wiedervorlage: WiedervorlageResource; @Input() wiedervorlage: WiedervorlageResource;
public readonly formService = inject(WiedervorlageFormService);
public readonly formServiceClass = WiedervorlageFormService; public readonly formServiceClass = WiedervorlageFormService;
public readonly WiedervorlageListLinkRel = WiedervorlageListLinkRel; public readonly WiedervorlageListLinkRel = WiedervorlageListLinkRel;
public readonly WiedervorlageLinkRel = WiedervorlageLinkRel; public readonly WiedervorlageLinkRel = WiedervorlageLinkRel;
public readonly WIEDERVORLAGE_UPLOADED_ATTACHMENTS = WIEDERVORLAGE_UPLOADED_ATTACHMENTS; public readonly WIEDERVORLAGE_UPLOADED_ATTACHMENTS = WIEDERVORLAGE_UPLOADED_ATTACHMENTS;
constructor(public formService: WiedervorlageFormService) {}
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes.wiedervorlage && isNotNil(this.wiedervorlage)) { if (changes.wiedervorlage && isNotNil(this.wiedervorlage)) {
this.patchWiedervorlage(); this.patchWiedervorlage();
...@@ -56,8 +55,4 @@ export class WiedervorlageFormComponent implements OnChanges { ...@@ -56,8 +55,4 @@ export class WiedervorlageFormComponent implements OnChanges {
this.formService.patch(this.wiedervorlage); this.formService.patch(this.wiedervorlage);
} }
} }
protected readonly KOMMENTAR_UPLOADED_ATTACHMENTS = KOMMENTAR_UPLOADED_ATTACHMENTS;
protected readonly kommentarListLinkRel = KommentarListLinkRel;
protected readonly KommentarLinkRel = KommentarLinkRel;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment