Describe the bug
Building DSpace Angular generates Angular compiler warning NG8113 for imports that are declared in standalone component imports but are not actually used in their templates.
The warnings observed are:
Warning: src/app/shared/orcid-badge-and-tooltip/orcid-badge-and-tooltip.component.ts:31:5 - warning NG8113: NgClass is not used within the template of OrcidBadgeAndTooltipComponent
Warning: src/themes/custom/app/submission/sections/upload/file/section-upload-file.component.ts:20:5 - warning NG8113: ThemedFileDownloadLinkComponent is not used within the template of SubmissionSectionUploadFileComponent
Version:
To Reproduce
-
Check out DSpace Angular 10.0.
-
Build the Angular frontend:
or
-
Review the build output.
-
Observe the NG8113 warnings for:
NgClass in OrcidBadgeAndTooltipComponent
ThemedFileDownloadLinkComponent in SubmissionSectionUploadFileComponent
Expected behavior
Components should not import standalone dependencies that are not used in their templates.
The build should complete without NG8113 warnings.
Actual behavior
The Angular compiler reports NG8113 warnings because:
NgClass is imported but not used in OrcidBadgeAndTooltipComponent.
ThemedFileDownloadLinkComponent is imported but not used in SubmissionSectionUploadFileComponent.
Related work
Potential fix:
- Remove the unused
NgClass import from OrcidBadgeAndTooltipComponent.
- Remove the unused
ThemedFileDownloadLinkComponent import from SubmissionSectionUploadFileComponent, or use it in the template if intended.
Describe the bug
Building DSpace Angular generates Angular compiler warning
NG8113for imports that are declared in standalone component imports but are not actually used in their templates.The warnings observed are:
Version:
DSpace Angular 10.0
Browser:
Not applicable (build-time issue)
To Reproduce
Check out DSpace Angular 10.0.
Build the Angular frontend:
or
Review the build output.
Observe the
NG8113warnings for:NgClassinOrcidBadgeAndTooltipComponentThemedFileDownloadLinkComponentinSubmissionSectionUploadFileComponentExpected behavior
Components should not import standalone dependencies that are not used in their templates.
The build should complete without
NG8113warnings.Actual behavior
The Angular compiler reports
NG8113warnings because:NgClassis imported but not used inOrcidBadgeAndTooltipComponent.ThemedFileDownloadLinkComponentis imported but not used inSubmissionSectionUploadFileComponent.Related work
Potential fix:
NgClassimport fromOrcidBadgeAndTooltipComponent.ThemedFileDownloadLinkComponentimport fromSubmissionSectionUploadFileComponent, or use it in the template if intended.