Closed bernardocs closed 7 years ago
@bernardocs most likely you are not including the editor JS files.
@bernardocs This should be solved with the up-to-date version (v2.7.5
) with the PR I've made.
The caveat is this new line: if (jQuery) element = jQuery(element);
(https://github.com/froala/angular-froala/blob/master/src/angular-froala.js#L33)
Before, angular-froala was assuming the user of the library will always have jQuery globally and it will auto-wrap the angular element in link function when jQuery was there. This might not be true when you have a non-trivial webpack config.
By explicitly wrap it with jQuery, we make sure this .froalaEditor
object is accessible when it is needed.
Hey guys... 😄
I've searched in every corner for a solution for the
element.froalaEditor is not a function
problem... found a bunch of similar situations but most of then did not included webpack.For context, we're using Angular + Webpack 2 with Babel. We used npm to install the package. Should we, I don't know, somehow include the
froala-editor
package before everything or something? Because that's the general solution that everyone gives when it comes to this error.I'm getting this error while trying to use the directive and still didn't figured it out how to solve this without having to add a bunch of script tags, importing everything (that's why webpack is in the project). 😖
Any ideas, guys?! 🤔