nenadpnc / cl-editor

Lightweight text editor built with svelte, typescript
https://nenadpnc.github.io/cl-editor/
MIT License
293 stars 23 forks source link

Events don't seem to work #20

Closed Omar-ABDELNABY closed 4 years ago

Omar-ABDELNABY commented 4 years ago

I'm trying to wrap this into an angular component to use it in an angular project I can't find a way to listen to change event, I followed the readme.md with something like this: editor.on('change', (html) => console.log(html)); editor.$on('change', (html) => console.log(html)); and I got an error Property 'on' does not exist on type 'Editor' image

Omar-ABDELNABY commented 4 years ago

Any update on this?

nenadpnc commented 4 years ago

Hi @Omar-ABDELNABY thanks for reporting 👍 . Typescript definition file was not updated. Correct syntax is this.editor.$on('change', (event) => console.log(event)). Fixed in v2.1.0. I've also updated Readme.md.