Open bence-balogh-intland opened 2 years ago
I found a workaround, although it is more likely a temporary solution: https://github.com/bence-balogh-intland/angular-froala-test/compare/add-froala...fix-froala
froala-editor/js/plugins.pkgd.min.js
into somewhere, e.g. app.module.ts
- solves missing featureswindow.FroalaEditor
on init - solves customization
Hi Guys,
We are using
froala-editor
package, together withangular-froala-wysiwyg
. We recognized the following behaviors with the new version of these packages:FroalaEditor
global object, as it is described here: https://froala.com/wysiwyg-editor/docs/concepts/custom/button/FroalaEditorDirective
importsFroalaEditor
fromfroala_editor.min.js
instead offroala_editor.pkgd.min.js
which causes lack of functionalities (e.g. in toolbar)These issues have been traced back to the following root cause:
FroalaEditorDirective
imports directlyFroalaEditor
object/constructor fromfroala-editor
like: https://github.com/froala/angular-froala-wysiwyg/blob/master/projects/library/src/editor/editor.directive.ts#L4I have created a test repo for demonstration with both Angular and Non-Angular version of the editor: https://github.com/bence-balogh-intland/angular-froala-test/compare/master...add-froala With the following result:
Please consider the following differences between the 2 editors:
For curiosity I checked what happens if I remove the line of the following import from
node_modules\...\angular-froala-wysiwyg.js
:import FroalaEditor from 'froala-editor';
And as you can see, it solved all of the points above:
So my suggestion would be to remove the import of
FroalaEditor
fromangular-froala-wysiwyg
, and leave this resolution for the host applications, sincefroala-editor
appendsFroalaEditor
to the window object on initialization. E.g. one possible way to do that: https://github.com/bence-balogh-intland/angular-froala-test/compare/master...add-froala#diff-2d2675bb4687601a5c7ccf707455132f90f3516a33716185687e5c41df59ac7dR36Checked with: angular-froala-wysiwyg: 4.0.14 froala-editor: 4.0.14 Node: 14.18.0 Angular: 14.2.0
Thanks in advance!