-
Notifications
You must be signed in to change notification settings - Fork 128
Model Not Updating Last Action #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think your problem is similar with #4 |
Inserting an image doesn't update the ng-model. If you then perform any other action after the image is entered the image is saved to the ng-model. This has only been tested with local images using the browse function. |
I will check it out again. |
Inserting an image doesn't update the ng-model. +1) |
@amondnet I got it. obviously something is wrong. I'm pretty busy now, so I will check soon. |
Inserting an image doesn't update the ng-model. +1 :P |
+1 |
Any progress on stabilizing the ng-model updates I too an waiting for image insert fix |
@jhoganrg |
Hi all, this is how I fixed this: https://gist.github.com/mentat/05f906fa9b99e33308e4 I added an extra callback to the summernote insertImage function that creates an "onChange" event and a small function on angular-summernote that listens for the event and calls updateNgModel(). There is probably a much better way to do this, but this is what I came up with. |
Am not entirely sure this is a good fix but works all the same with little overhead. I implemented the onfocus method to call updateNgModel. So you can add this after the summernoteConfig.onkeyup function: summernoteConfig.onfocus = function(evt) { Note: The editable area gains focus after a link, image or video is inserted so this method works. |
@biblicalph Error: [$rootScope:inprog] $digest already in progress 53th line is a part of calling updateNgModel() in the added onfocus func. |
@monad98 Ok am not entirely sure why you are getting this error but I will check and get back to you. Fingers crossed |
@monad98 angular.module('summernote', [])
As you can see the only addition I have made is the onfocus event. If you can, snip and replace your angular-summernote file with the above code and let me know if it works. Regards |
@biblicalph
|
I'm working on this. |
please check v0.2.3 |
I've noticed a peculiar issue.
When your last action is not a keystroke but an action from the menubar, like adding a link to a selected bit of text or changing font size or what have you, the model isn't being updated. If you type a bit of text and remove it, or something of that nature the model is updated and works as expected. This appears to be a design flaw in how the model is updated.
As I am not an Angular expert quite yet I would appreciate some assistance.
Thanks.
The text was updated successfully, but these errors were encountered: