Which scope/s are relevant/related to the feature request?
Docs
Information
Astro has an integration for mdx and I wanted to use an Angular component in the mdx file.
I couldn't find anything about mdx in docs for @analogjs/astro-angular.
Here is how it worked for me:
You need @astrojs/mdx and @analogjs/astro-angular installed and configured in astro.config.mjs
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import angular from "@analogjs/astro-angular";
// https://astro.build/config
export default defineConfig({
site: "https://example.com",
integrations: [mdx(), angular()]
});
Create an Angular component (e.g. src/components/hello.component.ts)
Which scope/s are relevant/related to the feature request?
Docs
Information
Astro has an integration for mdx and I wanted to use an Angular component in the mdx file. I couldn't find anything about mdx in docs for
@analogjs/astro-angular
.Here is how it worked for me:
@astrojs/mdx
and@analogjs/astro-angular
installed and configured inastro.config.mjs
src/components/hello.component.ts
).mdx
file (e.g.pages/blog/using-mdx.mdx
) and import the component below the front matter.The Angular component is rendered correctly. To make it interactive add a client directive
client:visible
.An error occurred after adding the client directive and the component wasn't interactive.
Solution is to add
ts
suffix to the component import.Now the error is gone, component loaded properly and interactive.
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue