# ng2-codemirror-typescript

> Angular2 Codemirror component

Latest version **3.13.1** (published 2022-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng2-codemirror-typescript
pnpm add ng2-codemirror-typescript
yarn add ng2-codemirror-typescript
bun add ng2-codemirror-typescript
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.13.1 |
| Published | 2022-03-23 |
| First published | 2016-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Steven Guiheux |
| Maintainers | sguiheux |
| Keywords | angular, angular2, component, codemirror |

## Links

- npm: https://www.npmjs.com/package/ng2-codemirror-typescript
- Repository: https://github.com/sguiheux/ng2-codemirror-typescript
- Homepage: https://github.com/sguiheux/ng2-codemirror-typescript#readme
- Issues: https://github.com/sguiheux/ng2-codemirror-typescript/issues
- npm.io page: https://npm.io/package/ng2-codemirror-typescript

## Recent versions

- 3.13.1 (latest) — 2022-03-23
- 3.13.0 — 2022-03-23
- 3.0.1 — 2020-09-14
- 3.0.0 — 2020-09-14
- 2.0.0 — 2019-06-11
- 1.1.2 — 2018-03-26
- 1.1.1 — 2017-03-30
- 1.1.0 — 2017-03-30
- 1.0.2 — 2016-12-23

## README

# Angular2 - Codemirror component

Typescript version of https://github.com/chymz/ng2-codemirror

### <a name="install"></a>Installation

- Include Codemirror javascript files in your application (with files for modes)
- Install ng2-codemirror-typescript
  - NPM : `npm install ng2-codemirror-typescript`

### <a name="dependencies"></a>Dependencies
CodeMirror library is required for this component :
  - Install via NPM : `npm install codemirror`

CodeMirror need to be accessible by `import 'codemirror'`

Then you need to include base CSS of codemirror located in `codemirror/lib/codemirror.css`

Pay attention, if you want to use placeholder you need to import `codemirror/addon/display/placeholder.js`

### <a name="sample"></a>Sample (ES2016+)

Include `CodemirrorModule` in your main module :

```javascript
import {CodemirrorModule} from 'ng2-codemirror/Codemirror';

@NgModule({
  // ...
  imports:      [
    CodemirrorModule
  ],
  // ...
})
export class AppModule { }
```

```javascript
import {Component} from 'angular2/core';

@Component({
  selector: 'sample',
  template: `<codemirror [(ngModel)]="code" [config]="{...}" placeholder="Here is the code placeholder"></codemirror>`
})
export class Sample{
  constructor(){
    this.code = `// Some code...`;
  }
}
```

---
_Source: https://npm.io/package/ng2-codemirror-typescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
