All Projects → alauda → ng-monaco-editor

alauda / ng-monaco-editor

Licence: MIT license
Angular wrapper for monaco-editor.

Programming Languages

typescript
32286 projects
SCSS
7915 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ng-monaco-editor

ZSpider
基于Electron爬虫程序
Stars: ✭ 37 (+68.18%)
Mutual labels:  monaco-editor
ngx-echarts-starter
A starter demo project for ngx-echarts
Stars: ✭ 29 (+31.82%)
Mutual labels:  ng
monaco-loader
The utility to easy setup monaco-editor into your browser
Stars: ✭ 85 (+286.36%)
Mutual labels:  monaco-editor
ngx-ui-switch
Angular UI Switch component
Stars: ✭ 109 (+395.45%)
Mutual labels:  ng
emmet-monaco
Emmet support for monaco-editor
Stars: ✭ 19 (-13.64%)
Mutual labels:  monaco-editor
wiql-editor
Search work items with wiql queries.
Stars: ✭ 30 (+36.36%)
Mutual labels:  monaco-editor
ngx-echarts
Apache ECharts component for Angular(基于 Angular 的 Apache ECharts 组件)
Stars: ✭ 82 (+272.73%)
Mutual labels:  ng
rust-monaco
Rust WASM bindings for the Monaco Editor
Stars: ✭ 23 (+4.55%)
Mutual labels:  monaco-editor
monaco-editor-esm-webpack-plugin
No description or website provided.
Stars: ✭ 25 (+13.64%)
Mutual labels:  monaco-editor
ng2-go-top-button
A simple customizable go-top-button component for Angular projects.
Stars: ✭ 18 (-18.18%)
Mutual labels:  ng
Operational-Transformation
A collection of Algorithms to Synchronise changes across multiple clients using Operational Transformation
Stars: ✭ 25 (+13.64%)
Mutual labels:  monaco-editor
bundle
An online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.
Stars: ✭ 475 (+2059.09%)
Mutual labels:  monaco-editor
ovid-editor
Adobe panel providing the most advanced scripting environment possible -- Typescript, app DOM autocomplete, full I/O features and more
Stars: ✭ 43 (+95.45%)
Mutual labels:  monaco-editor
V2releases
A friendly ARM assembler and simulator for educational use
Stars: ✭ 46 (+109.09%)
Mutual labels:  monaco-editor
mmpm
MagicMirror Package Manager
Stars: ✭ 104 (+372.73%)
Mutual labels:  monaco-editor
mongood
A MongoDB GUI with Fluent Design
Stars: ✭ 674 (+2963.64%)
Mutual labels:  monaco-editor
react-monacoeditor
Monaco Editor component for React.
Stars: ✭ 191 (+768.18%)
Mutual labels:  monaco-editor
use-monaco
Use 🗒️ monaco-editor in any ⚛️ React app with simple hooks 🎣
Stars: ✭ 85 (+286.36%)
Mutual labels:  monaco-editor
editor.sh
Yet another live programming environment for collaborative code editing and running.
Stars: ✭ 29 (+31.82%)
Mutual labels:  monaco-editor
Blazaco
A Blazor Component utilizing the Monaco editor by Microsoft
Stars: ✭ 23 (+4.55%)
Mutual labels:  monaco-editor

Angular wrapper for monaco-editor

GitHub Release Workflow Status GitHub Stories Workflow Status npm

Dependencies

Demo

See: https://ng-monaco-editor.js.org or https://ng-monaco-editor.netlify.app

Setup

Add npm dependencies

# npm
npm i monaco-editor ng-monaco-editor

# yarn
yarn add monaco-editor ng-monaco-editor

Configure monaco-editor library assets

It's supported to load monaco-editor with AMD or ESM mode.

If you'd like to use AMD mode, you have to make sure your Angular application could have access to the monaco-editor library assets via AMD. If you are using Angular CLI to bootstrap your app, you could add the following:

{
  "assets": [
    "src/favicon.ico",
    "src/assets",

    {
      "glob": "**/*",
      "input": "node_modules/monaco-editor/min/vs",
      "output": "/lib/vs"
    }
  ]
}

Load ng-monaco-editor module

Most of the time, you should configure the module at the root module.

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    FormsModule,
    MonacoEditorModule.forRoot({
      /**
       * optional, load monaco by yourself, you'd prefer loading esm for example
       */
      dynamicImport: () => import('monaco-editor'),

      /**
       * optional, use amd loader to load monaco if present, lower priority than `dynamicImport`
       *
       * Angular CLI currently does not handle assets with hashes. We manage it by manually adding
       * version numbers to force library updates:
       */
      baseUrl: 'lib/v1',

      defaultOptions: {},
    }),
  ],
  providers: [
    {
      // Optional:
      // You could also override the default MonacoEditor provider.
      // If you plan to do so, I recommend you to read through the source code.
      provide: MonacoProviderService,
      useClass: CustomMonacoProviderService,
    },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

Usage example

Please refer to the storybook (stories/**/*.stories.ts).

This module provide three usages:

  1. ng-monaco-editor component
  2. ng-monaco-diff-editor component
  3. ngCodeColorize directive

Note, if the height of ng-monaco-editor/ng-monaco-diff-editor is too small, you may have to resize it yourself. This is a limitation and by design that how monaco-editor works.

License

MIT @Alauda

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].