Skip to content

Commit

Permalink
Merge pull request #29069 from JSMike/jsmike/angular-sourceDecorator
Browse files Browse the repository at this point in the history
Angular: Fix sourceDecorator to apply excludeDecorators flag
  • Loading branch information
valentinpalkovic authored Sep 16, 2024
2 parents 6019553 + 19a68df commit b0d55ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/frameworks/angular/src/client/docs/sourceDecorator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SNIPPET_RENDERED, SourceType } from 'storybook/internal/docs-tools';
import { addons, useEffect } from 'storybook/internal/preview-api';
import { PartialStoryFn } from 'storybook/internal/types';
import { ArgsStoryFn, PartialStoryFn } from 'storybook/internal/types';

import { computesTemplateSourceFromComponent } from '../../renderer';
import { AngularRenderer, StoryContext } from '../types';
Expand Down Expand Up @@ -32,9 +32,11 @@ export const sourceDecorator = (
return story;
}
const channel = addons.getChannel();
const { props, template, userDefinedTemplate } = story;

const { props, userDefinedTemplate } = story;
const { component, argTypes, parameters } = context;
const template: string = parameters.docs?.source?.excludeDecorators
? (context.originalStoryFn as ArgsStoryFn<AngularRenderer>)(context.args, context).template
: story.template;

let toEmit: string;

Expand Down

0 comments on commit b0d55ed

Please sign in to comment.