ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - acrodata/code-editor: 📝 CodeMirror 6 wrapper for Angular
📝 CodeMirror 6 wrapper for Angular. Contribute to acrodata/code-editor development by creating an account on GitHub.
Visit Site

GitHub - acrodata/code-editor: 📝 CodeMirror 6 wrapper for Angular

GitHub - acrodata/code-editor: 📝 CodeMirror 6 wrapper for Angular

Code Editor

npm license

CodeMirror 6 wrapper for Angular

Quick links

Documentation | Playground

Installation

npm install @acrodata/code-editor --save

Usage

Code Editor

import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CodeEditor } from '@acrodata/code-editor';

@Component({
  selector: 'your-app',
  template: `<code-editor [(ngModel)]="value" />`,
  standalone: true,
  imports: [FormsModule, CodeEditor],
})
export class YourAppComponent {
  value = `console.log("Hello world")`;
}

Diff Editor

import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { DiffEditor } from '@acrodata/code-editor';

@Component({
  selector: 'your-app',
  template: `<diff-editor [(ngModel)]="value" />`,
  standalone: true,
  imports: [FormsModule, DiffEditor],
})
export class YourAppComponent {
  value = {
    original: `bar`;
    modified: `foo`;
  }
}

API

Code Editor

Name Type Default Description
[value] string '' The editor's value.
[root] Document | ShadowRoot undefined EditorView's root.
[autoFocus] boolean false Whether focus on the editor after init.
[disabled] boolean false Whether the editor is disabled.
[readonly] boolean false Whether the editor is readonly.
[theme] Theme light The editor's theme.
[placeholder] string '' The editor's placecholder.
[indentWithTab] boolean false Whether indent with Tab key.
[indentUnit] string '' Should be a string consisting either entirely of the same whitespace character.
[lineWrapping] boolean false Whether the editor wraps lines.
[highlightWhitespace] boolean false Whether highlight the whitespace.
[languages] LanguageDescription[] [] An array of language descriptions for known language-data.
[language] string '' The editor's language. You should set the languages prop at first.
[setup] Setup 'basic' The editor's built-in setup. The value can be set to basic, minimal or null.
[extensions] Extension[] [] It will be appended to the root extensions.
(change) EventEmitter - Event emitted when the editor's value changes.
(focus) EventEmitter - Event emitted when focus on the editor.
(blur) EventEmitter - Event emitted when the editor has lost focus.

Diff Editor

Name Type Default Description
[setup] Setup 'basic' The editor's built-in setup. The value can be set to basic, minimal or null.
[originalValue] string '' The diff-editor's original value.
[originalExtensions] Extension[] [] The MergeView original config's extensions.
[modifiedValue] string '' The diff-editor's modified value.
[modifiedExtensions] Extension[] [] The MergeView modified config's extensions.
[orientation] Orientation undefined Controls whether editor A or editor B is shown first. Defaults to "a-b".
[revertControls] RevertControls undefined Controls whether revert controls are shown between changed chunks.
[renderRevertControl] RenderRevertControl undefined When given, this function is called to render the button to revert a chunk.
[highlightChanges] boolean true By default, the merge view will mark inserted and deleted text in changed chunks.
[gutter] boolean true Controls whether a gutter marker is shown next to changed lines.
[disabled] boolean false Whether the diff-editor is disabled.
[collapseUnchanged] { margin?: number; minSize?: number } undefined When given, long stretches of unchanged text are collapsed.
[diffConfig] DiffConfig undefined Pass options to the diff algorithm.
(originalValueChange) EventEmitter - Event emitted when the editor's original value changes.
(originalFocus) EventEmitter - Event emitted when focus on the original editor.
(originalBlur) EventEmitter - Event emitted when blur on the original editor.
(modifiedValueChange) EventEmitter - Event emitted when the editor's modified value changes.
(modifiedFocus) EventEmitter - Event emitted when focus on the modified editor.
(modifiedBlur) EventEmitter - Event emitted when blur on the modified editor.

License

MIT

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory