From 9a58863ee4779db119ee800c27d54d58ea5c6174 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Mon, 22 Jul 2024 09:28:43 -0400 Subject: [PATCH] fix(design): update createCustomElementFromExample for API break --- .../elements/create-element-from-example.ts | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/apps/design-land/src/app/core/elements/create-element-from-example.ts b/apps/design-land/src/app/core/elements/create-element-from-example.ts index adde9263cc..b8dac41591 100644 --- a/apps/design-land/src/app/core/elements/create-element-from-example.ts +++ b/apps/design-land/src/app/core/elements/create-element-from-example.ts @@ -1,26 +1,15 @@ import { - ɵcreateInjector, Injector, + Type, } from '@angular/core'; import { createCustomElement } from '@angular/elements'; -import { ComponentExample } from '@daffodil/design'; - /** * Creates a custom element from a Component Example to be used to render complex * component examples in the docs. */ -export const createCustomElementFromExample = (example: ComponentExample, injector: Injector) => { - if(typeof example === 'function'){ - return { - element: createCustomElement(example, { injector }), - class: example, - }; - } else { - return { - element: createCustomElement(example.component, { injector: ɵcreateInjector(example.module, injector) }), - class: example.component, - }; - } -}; +export const createCustomElementFromExample = (example: Type, injector: Injector) => ({ + element: createCustomElement(example, { injector }), + class: example, +});