在Angular中,是否可以从组件而不是Angular.json导入美人鱼?
我使用的是Angular 14和NGX-MARKDOWN 14.0.0与Mermaid插件(与NGX-MarkDown集成)。
如果我在Angular.json的脚本中添加“ Node_modules/mermaid/dist/mermaid.js”。
为此,我在组件中使用:
import "node_modules/mermaid/dist/mermaid.min";
但是我会发现错误:
[ngx-markdown] When using the mermaid attribute you *have to* include Mermaid files toangular.json or use imports. See README for more information
问题是,我如何从组件中加载美人鱼脚本并使NGX-Markdown起作用?
事先感谢您的帮助。
I am using Angular 14 and ngx-markdown 14.0.0 with mermaid plugin (integrated with ngx-markdown).
If I add "node_modules/mermaid/dist/mermaid.min.js" in scripts of angular.json everything works well, but I would like to load that big file only when my custom angular component loads.
For that I use in the component:
import "node_modules/mermaid/dist/mermaid.min";
but I get the error:
[ngx-markdown] When using the mermaid attribute you *have to* include Mermaid files toangular.json or use imports. See README for more information
The question is, how could I load mermaid script from the component and making ngx-markdown works?
Thanks in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论