Skip to content

How do you import an Angular Component in an MDX file ? #25006

Answered by Marklb
apollyV asked this question in General
Discussion options

You must be logged in to vote

I haven't looked at why combining the default and named export doesn't let you import the named export in MDX, but that error goes away if you declare them separately.

export class ColorsComponent {}

export default ColorsComponent

Here is a Stackblitz without that error, by splitting them: https://stackblitz.com/edit/github-cbqhye?file=src%2Fapp%2Fcolors%2Fcolors.component.ts,src%2Fapp%2Fcolors%2Fcolors.mdx&preset=node

That doesn't fix the problem of what you are trying to do, though. You are referencing color variables, in a static way, that are not static. Those variables would only be available within a story that is initializing your component in an Angular app. It looks like you are…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by apollyV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants