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
(cherry picked from commit b0d55ed)
  • Loading branch information
valentinpalkovic authored and storybook-bot committed Sep 16, 2024
1 parent bba5c8f commit 2e89a07
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 2e89a07

Please sign in to comment.