I am trying insert image like this:
this.editor.insertEmbed(index, 'image', img);
it works. But ngModel can not detect this change unless input something in the editor manually after that.
how to fix it. Thanks a lot!
You have to Pass the source 'user' As source of the Change. Per Definition
of ngmodel and Formcontrol IT only handles real User Interactions and not
programmatically Changes.
There is also an Input Option to Track all Changes from any quill source ;)
chuJianNi notifications@github.com schrieb am Di., 30. Apr. 2019, 06:01:
I am trying insert image like this:
this.editor.insertEmbed(index, 'image', img);it works. But ngModel can not detect this change unless input something in
the editor manually after that.how to fix it. Thanks a lot!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/KillerCodeMonkey/ngx-quill/issues/377, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AARI4YDRR5WQGOD5H4VPK5TPS7ADJANCNFSM4HJILALA
.
how to do that...
just take a look in the quill api:
https://quilljs.com/docs/api/#insertembed
the last parameter is the source string -> defaults to api ;).
And just pass a fourth parameter with the string 'user' .
Or if you want to track all changes per default:
checkout the ngx-quill readme:
https://github.com/KillerCodeMonkey/ngx-quill#config (the second last bullet point).
trackChanges - check if only user (quill source user) or all change should be trigger model update, default user. Using all is not recommended, it cause some unexpected sideeffects.
Most helpful comment
just take a look in the quill api:
https://quilljs.com/docs/api/#insertembed
the last parameter is the source string -> defaults to api ;).
And just pass a fourth parameter with the string 'user' .
Or if you want to track all changes per default:
checkout the ngx-quill readme:
https://github.com/KillerCodeMonkey/ngx-quill#config (the second last bullet point).