froala / angular-froala

Angular.js bindings for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
MIT License
306 stars 123 forks source link

angular-froala does not show content before click when initOnClick set to true #164

Closed agabhane closed 6 years ago

agabhane commented 6 years ago

I am using angular-froala with angular 1.5.x and came across the below issue.

I am initializing froala with initOnClickas true. The problem is, it is not showing content before clicking. If my variable given to ng-model is not empty then it should display the content and not placeholder. Please find attached punker

Example: If $scope.myHtml = "<p>Some text</p>";

Actual: Editor displays default placeholder before clicking.

Expected: Editor should display "Some text" before clicking

FWennerdahl commented 6 years ago

We're also affected by this issue and it's preventing us from using Froala in production.

Just to make sure that this was an issue in angular-froala we created a jsfiddle using Froala without angular, where the issue is not reproducible: https://jsfiddle.net/a9h6kpy0/

FWennerdahl commented 6 years ago

Fix seems to work. Thanks!

stefanneculai commented 6 years ago

It should be fixed on the current master. Could you please check?

On 3 Mar 2018, at 15:17, Frank Wennerdahl notifications@github.com wrote:

@stefanneculai: The issue is that the 'froalaEditor.initialized' isn't fired when using initOnClick: true until the editor has been clicked. 01bcc7d doesn't fix this as flushNgModel() still won't be executed until this event has fired.

Also, when it does ctrl.initializedwill be set to true anyway so the added line won't be executed.

Please re-consider #171 as it has taken these things into consideration.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

FWennerdahl commented 6 years ago

Yes, I noticed the other changes in e124ecfd2afdde6707dda2aa34990ee0d107ddce after I posted the message. Tested and it's working 👍