surmon-china / ngx-quill-editor

🍡@quilljs editor component for @angular
https://github.surmon.me/ngx-quill-editor
MIT License
232 stars 54 forks source link

I can't add Undo/Redo Buttons to quill-editor #69

Open didacpr opened 5 years ago

didacpr commented 5 years ago

Hi! I've installed the ngx-quill-editor and it works perfectly, but I need to add the Undo/Redo buttons and I can't make it works.

Here you have a github repository that I've created and reproduced the Issue. https://github.com/didacpr/quill-editor

I'm using:

What am I doing wrong?

Thanks!

amr-ayman commented 4 years ago

Hello @didacpr I had the same problem After much reading, I came up with this solution:- quill; options = { toolbar: { container: [ ['bold', 'italic', 'link', {list: 'bullet'}, {list: 'ordered'}, 'blockquote', {redo: 'redo'}, {undo: 'undo'} ] ], handlers: { redo() { this.quill.history.redo(); }, undo() { this.quill.history.undo(); } } }, history: { delay: 2000, maxStack: 500, userOnly: true } };

And for the HTML:- <quill-editor (onEditorCreated)="quill = $event" [modules]="options"></quill-editor>

And it works fine. Happy coding ;)