Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Adding bidirectionnal binding with ngModel #106

Closed
wants to merge 1 commit into from

Conversation

strokyl
Copy link

@strokyl strokyl commented Nov 20, 2014

I had a problem using ui-tinymce with ngModel because i binded my tinyMCE with a string fetched from a webservice. I have noticed that when the webservice response after that tinyMCE have render, the string does not appear.
Then I noticed that the binding is unilateral : a change from tinyMCE will be reflected on the scope, but a change on the scope won't be reflected on tinyMCE.
I made this fixe, i am new with AngularJS so it is probably a poor solution.
I won't be surprise if you deny my pull request, but I wish you will fixe this bug.

@wesleycho
Copy link
Contributor

This should now be fixed in master with the change to use a $formatter. Let me know if this is still an issue.

@wesleycho wesleycho closed this Jun 5, 2015
@strokyl
Copy link
Author

strokyl commented Jun 29, 2015

Hello wesleycho, sorry I have not see your answer until today. I have try the last version of tinyMCE and I still have this problem ! Adding my code from my pull request still fixing it also.

@wesleycho
Copy link
Contributor

To be clear, you're using 0.0.9 currently?

@strokyl
Copy link
Author

strokyl commented Jun 30, 2015

Yes, I am also using angular 1.2.28. I made a Plunker where you can see the problem :
http://plnkr.co/edit/npPuUZBCSd8B7ORCb2ne?p=preview.
The problem come from the fact that ngModel.$render is not fire.
In fact, the problem does not come from your directive but from Angular 1.2 :
angular/angular.js#4560
The ngModel.$render get overwritten by the default after you overwritten the default in the directive, a simple workaround is to set a positive priority to the ui-tinymce directive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants