# angular-draft-js

> Angular bindings for Draft.js

Latest version **1.0.2** (published 2018-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular-draft-js
pnpm add angular-draft-js
yarn add angular-draft-js
bun add angular-draft-js
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-01-25 |
| First published | 2018-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Anton Strogonoff |
| Maintainers | strogonoff |
| Keywords | angular, rich-text-editor, draft-js |

## Links

- npm: https://www.npmjs.com/package/angular-draft-js
- npm.io page: https://npm.io/package/angular-draft-js

## Dependencies (1)

- [draft-js-export-html](https://npm.io/package/draft-js-export-html.md) ^1.2.0

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-01-25
- 1.0.1 — 2018-01-25
- 1.0.0 — 2018-01-25

## README

# Angular bindings for Draft.js editor

ngx-draft-js wraps React-based Draft.js as an Angular 5 component,
bundling a rich editor from the official Draft.js example
with an addition of HTML export via draft-js-export-html package.

Draft.js is a framework for building rich text editors
developed by Facebook.

## Installation

ngx-draft-js was tested with Angular 5.

React, React DOM and Draft.js are specified as peer dependencies,
so add them yourself if you haven’t them in your project:

    yarn add react react-dom draft-js

Install the package itself:

    yarn add ngx-draft-js


## Using bundled rich text editor

Module import:

    import { DraftRichModue } from 'angular-draft-js/editors/rich.module';
    import { SomeComponentWithEditor } from './some.component';

    @NgModule({
        declarations: [
            SomeComponentWithEditor,
        ],
        imports: [
            DraftRichModule,
        ],
    })
    export class SomeModule {}


Basic usage in a component:

    @Component({
        template: `
            <draft-rich-html
                (html)="onHtmlChange($event)"
                placeholder="Write a story">
            </draft-rich-html>
        `,
    })
    export class SomeComponent {
        onHtmlChange($event: string) {
            console.debug('Got new HTML from the Draft.js editor', $event);
        }
    }

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