File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,34 @@ Install the package itself:
2323
2424## Using bundled rich text editor
2525
26- Import Angular module :
26+ Module import :
2727
2828 import { DraftRichModue } from 'angular-draft-js/editors/rich.module';
29+ import { SomeComponentWithEditor } from './some.component';
2930
3031 @NgModule({
32+ declarations: [
33+ SomeComponentWithEditor,
34+ ],
3135 imports: [
3236 DraftRichModule,
3337 ],
3438 })
3539 export class SomeModule {}
3640
3741
38- Use rich editor in a component:
42+ Basic usage in a component:
3943
40- <draft-rich-html (html)="onHtmlChange($event)" placeholder="Write a story"></draft-rich-html>
44+ @Component({
45+ template: `
46+ <draft-rich-html
47+ (html)="onHtmlChange($event)"
48+ placeholder="Write a story">
49+ </draft-rich-html>
50+ `,
51+ })
52+ export class SomeComponent {
53+ onHtmlChange($event: string) {
54+ console.debug('Got new HTML from the Draft.js editor', $event);
55+ }
56+ }
You can’t perform that action at this time.
0 commit comments