diff --git a/app/angular/src/client/preview/angular-beta/utils/NgComponentAnalyzer.ts b/app/angular/src/client/preview/angular-beta/utils/NgComponentAnalyzer.ts index 80233b875610..a1f3d51c3f13 100644 --- a/app/angular/src/client/preview/angular-beta/utils/NgComponentAnalyzer.ts +++ b/app/angular/src/client/preview/angular-beta/utils/NgComponentAnalyzer.ts @@ -107,13 +107,20 @@ export const isComponent = (component: any): component is Type => { */ export const getComponentPropsDecoratorMetadata = (component: any) => { const decoratorKey = '__prop__metadata__'; - const propsDecorators: Record = + let propsDecorators: Record = Reflect && Reflect.getOwnPropertyDescriptor && Reflect.getOwnPropertyDescriptor(component, decoratorKey) ? Reflect.getOwnPropertyDescriptor(component, decoratorKey).value : component[decoratorKey]; + const parent = Reflect && Reflect.getPrototypeOf && Reflect.getPrototypeOf(component); + + if (parent) { + const parentPropsDecorators = getComponentPropsDecoratorMetadata(parent); + propsDecorators = { ...parentPropsDecorators, ...propsDecorators }; + } + return propsDecorators; }; diff --git a/examples/angular-cli/src/stories/basics/component-with-inheritance/__snapshots__/inheritance.stories.storyshot b/examples/angular-cli/src/stories/basics/component-with-inheritance/__snapshots__/inheritance.stories.storyshot index 8bae8186a796..599db9b491d9 100644 --- a/examples/angular-cli/src/stories/basics/component-with-inheritance/__snapshots__/inheritance.stories.storyshot +++ b/examples/angular-cli/src/stories/basics/component-with-inheritance/__snapshots__/inheritance.stories.storyshot @@ -16,6 +16,7 @@ exports[`Storyshots Basics / Component / With Inheritance icon button 1`] = `