diff --git a/packages/planet/src/application/planet-application-ref.ts b/packages/planet/src/application/planet-application-ref.ts index f63cdf0..423747a 100644 --- a/packages/planet/src/application/planet-application-ref.ts +++ b/packages/planet/src/application/planet-application-ref.ts @@ -15,10 +15,10 @@ export interface BootstrapOptions { export type BootstrapAppModule = (portalApp?: PlanetPortalApplication) => Promise>; -export type PlantComponentFactory = ( +export type PlantComponentFactory = ( componentName: string, config: PlantComponentConfig -) => PlanetComponentRef; +) => PlanetComponentRef; export class PlanetApplicationRef { public appModuleRef: NgModuleRef; diff --git a/packages/planet/src/component/planet-component-loader.ts b/packages/planet/src/component/planet-component-loader.ts index e84425a..3e1bfd2 100644 --- a/packages/planet/src/component/planet-component-loader.ts +++ b/packages/planet/src/component/planet-component-loader.ts @@ -140,12 +140,16 @@ export class PlanetComponentLoader { }); } - load(app: string, componentName: string, config: PlantComponentConfig) { + load( + app: string, + componentName: string, + config: PlantComponentConfig + ): Observable> { const result = this.getPlantAppRef(app).pipe( map(appRef => { const componentFactory = appRef.getComponentFactory(); if (componentFactory) { - return componentFactory(componentName, config); + return componentFactory(componentName, config); } else { throw new Error(`${app} not registered components`); } diff --git a/packages/planet/src/component/planet-component-ref.ts b/packages/planet/src/component/planet-component-ref.ts index 15a0c80..49e268a 100644 --- a/packages/planet/src/component/planet-component-ref.ts +++ b/packages/planet/src/component/planet-component-ref.ts @@ -1,8 +1,8 @@ import { ComponentRef, ElementRef } from '@angular/core'; -export class PlanetComponentRef { +export class PlanetComponentRef { wrapperElement: HTMLElement; - componentInstance: TData; - componentRef: ComponentRef; + componentInstance: TComp; + componentRef: ComponentRef; dispose: () => void; }