Skip to content

Commit 0e01aeb

Browse files
committed
fix: expand example in README & troubleshoot CI integration
1 parent 35359fc commit 0e01aeb

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)