From 3aee9382004566a079eb153ec87b448db6efc4f7 Mon Sep 17 00:00:00 2001 From: Tijmen van de Meent Date: Mon, 15 Jul 2024 17:02:42 +0200 Subject: [PATCH] fix: use component selector as default fixes #123 --- libs/dialog/src/lib/dialog.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/dialog/src/lib/dialog.service.ts b/libs/dialog/src/lib/dialog.service.ts index a62b529..1dc82ed 100644 --- a/libs/dialog/src/lib/dialog.service.ts +++ b/libs/dialog/src/lib/dialog.service.ts @@ -6,6 +6,7 @@ import { inject, Injectable, Injector, + reflectComponentType, TemplateRef, Type, ViewRef, @@ -60,7 +61,7 @@ export class DialogService { const mergedConfig = this.mergeConfig(config); if (isComponent(componentOrTemplate)) { - mergedConfig.id ??= componentOrTemplate.name; + mergedConfig.id ??= reflectComponentType(componentOrTemplate)?.selector; } if (this.isOpen(mergedConfig.id)) {