diff --git a/packages/core/src/render3/component_ref.ts b/packages/core/src/render3/component_ref.ts index 3ac783fad51..b5e60d328da 100644 --- a/packages/core/src/render3/component_ref.ts +++ b/packages/core/src/render3/component_ref.ts @@ -186,6 +186,15 @@ export class ComponentFactory extends AbstractComponentFactory { override componentType: Type; override ngContentSelectors: string[]; isBoundToModule: boolean; + private cachedInputs: + | { + propName: string; + templateName: string; + isSignal: boolean; + transform?: (value: any) => any; + }[] + | null = null; + private cachedOutputs: {propName: string; templateName: string}[] | null = null; override get inputs(): { propName: string; @@ -193,11 +202,13 @@ export class ComponentFactory extends AbstractComponentFactory { isSignal: boolean; transform?: (value: any) => any; }[] { - return toInputRefArray(this.componentDef.inputs); + this.cachedInputs ??= toInputRefArray(this.componentDef.inputs); + return this.cachedInputs; } override get outputs(): {propName: string; templateName: string}[] { - return toOutputRefArray(this.componentDef.outputs); + this.cachedOutputs ??= toOutputRefArray(this.componentDef.outputs); + return this.cachedOutputs; } /**