Skip to content

Commit 759f0d1

Browse files
fix: load mermaid library and fix mermaidOptions provider config
Add mermaid.min.js to angular.json scripts so ngx-markdown can use the mermaid attribute, and add the required `provide: MERMAID_OPTIONS` key to satisfy the TypedValueProvider type constraint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c702b0f commit 759f0d1

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

frontend/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"stylePreprocessorOptions": {
4848
"includePaths": ["node_modules/@brumeilde/ngx-theme/presets/material"]
4949
},
50-
"scripts": [],
50+
"scripts": ["node_modules/mermaid/dist/mermaid.min.js"],
5151
"extractLicenses": false,
5252
"sourceMap": true,
5353
"optimization": false,

frontend/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { DynamicModule } from 'ng-dynamic-component';
1515
import { SignalComponentIoModule } from 'ng-dynamic-component/signal-component-io';
1616
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
1717
import { CookieService } from 'ngx-cookie-service';
18-
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
18+
import { MERMAID_OPTIONS, MarkdownModule, provideMarkdown } from 'ngx-markdown';
1919
import { NgxStripeModule } from 'ngx-stripe';
2020
import { AppComponent } from './app/app.component';
2121
import { AppRoutingModule } from './app/app-routing.module';
@@ -127,6 +127,7 @@ bootstrapApplication(AppComponent, {
127127
CookieService,
128128
provideMarkdown({
129129
mermaidOptions: {
130+
provide: MERMAID_OPTIONS,
130131
useValue: {
131132
startOnLoad: false,
132133
theme: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'default',

0 commit comments

Comments
 (0)