简体   繁体   English

摩纳哥编辑器与 angular6 应用程序集成

[英]monaco-editor integration with angular6 app

I'm trying to integrate Monaco Editor into my angular lib in an Angular-6 app, I'm new at this and the official docs doesn't have any setup guide for the implementation.我正在尝试将Monaco Editor集成到 Angular-6 应用程序中的 angular 库中,我是新手,官方文档没有任何实施设置指南。 Any advice or guidance would be greatly appreciated.任何建议或指导将不胜感激。

Use the ngx-monaco-editor NPM module使用ngx-monaco-editor NPM 模块

It provides support for various angular versions它提供对各种 angular 版本的支持

In your case for Angular 6 you need to do在您的 Angular 6 的情况下,您需要做

npm install ngx-monaco-editor@6.0.0 --save

then reference the module in your app.module然后在您的 app.module 中引用该模块

import { MonacoEditorModule } from 'ngx-monaco-editor';
...
imports: [
...
MonacoEditorModule.forRoot(),
...

and then in your html component you can use it like such:然后在您的 html 组件中,您可以像这样使用它:

<ngx-monaco-editor ... ></ngx-monaco-editor>

Read the readme here: https://www.npmjs.com/package/ngx-monaco-editor在此处阅读自述文件: https://www.npmjs.com/package/ngx-monaco-editor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM