Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acrodata/code-editor
CodeMirror 6 wrapper for Angular
https://github.com/acrodata/code-editor
Last synced: 3 months ago
JSON representation
CodeMirror 6 wrapper for Angular
- Host: GitHub
- URL: https://github.com/acrodata/code-editor
- Owner: acrodata
- License: mit
- Created: 2024-05-20T15:19:31.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-22T15:07:57.000Z (6 months ago)
- Last Synced: 2024-05-22T16:03:52.505Z (6 months ago)
- Language: HTML
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-angular - acrodata/code-editor - CodeMirror 6 wrapper for Angular. (Table of contents / Third Party Components)
- fucking-awesome-angular - acrodata/code-editor - CodeMirror 6 wrapper for Angular. (Table of contents / Third Party Components)
- fucking-awesome-angular - acrodata/code-editor - CodeMirror 6 wrapper for Angular. (Table of contents / Third Party Components)
README
# Code Editor
[![npm](https://img.shields.io/npm/v/@acrodata/code-editor.svg)](https://www.npmjs.com/package/@acrodata/code-editor)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/acrodata/code-editor/blob/main/LICENSE)CodeMirror 6 wrapper for Angular
#### Quick links
[Documentation](https://acrodata.github.io/code-editor/) |
[Playground](https://acrodata.github.io/code-editor/)## Installation
```bash
npm install @acrodata/code-editor --save
```## Usage
### Code Editor
```ts
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CodeEditor } from '@acrodata/code-editor';@Component({
selector: 'your-app',
template: ``,
standalone: true,
imports: [FormsModule, CodeEditor],
})
export class YourAppComponent {
code = `console.log("Hello world")`;
}
```### Diff Editor
```ts
import { Component } from '@angular/core';
import { DiffEditor } from '@acrodata/code-editor';@Component({
selector: 'your-app',
template: ``,
standalone: true,
imports: [DiffEditor],
})
export class YourAppComponent {
originalCode = `bar`;
modifiedCode = `foo`;
}
```## License
MIT