Skip to content

Commit

Permalink
Fixed #522
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed May 27, 2017
1 parent 9e5caca commit 135fef3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/editor/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export class Editor implements AfterViewInit,ControlValueAccessor {

@Input() formats: string[];

@Output() onInit: EventEmitter<any> = new EventEmitter();

value: string;

onModelChange: Function = () => {};
Expand Down Expand Up @@ -139,6 +141,10 @@ export class Editor implements AfterViewInit,ControlValueAccessor {
source: source
});
});

this.onInit.emit({
editor: this.quill
});
}

writeValue(value: any) : void {
Expand All @@ -159,6 +165,10 @@ export class Editor implements AfterViewInit,ControlValueAccessor {
registerOnTouched(fn: Function): void {
this.onModelTouched = fn;
}

getQuill() {
return this.quill;
}
}

@NgModule({
Expand Down
27 changes: 27 additions & 0 deletions showcase/demo/editor/editordemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,39 @@ <h3>Events</h3>
event.source: Source of change. Will be either "user" or "api".</td>
<td>Callback to invoke when selected text of editor changes.</td>
</tr>
<tr>
<td>onInit</td>
<td>event.editor: Quill editor instance.<br>
event.oldRange: Object with index and length keys indicating where the previous selection was..<br>
event.source: Source of change. Will be either "user" or "api".</td>
<td>Callback to invoke after editor is initialized.</td>
</tr>
</tbody>
</table>
</div>

<p>Refer to <a href="http://beta.quilljs.com/docs/api/#events">Quill documentation</a> for more information.</p>

<h3>Methods</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Parameters</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>getQuill</td>
<td>-</td>
<td>Returns the underlying quill instance.</td>
</tr>
</tbody>
</table>
</div>

<h3>Styling</h3>
<p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
<div class="doc-tablewrapper">
Expand Down

0 comments on commit 135fef3

Please sign in to comment.