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
tinymce not added to window if only tinymce is imported [TinyMCE+Webpack+Angular2] #3396
Comments
The solution for me was to add This means that every page of my app has a dependency of both TinyMCE and JQuery. Kind of a bummer but it works for now. I'll leave this open in case there's a better solution but feel free to close. |
Sorry not an Angular/Webpack specialist - is there a way of including external module, without requiring it? |
require.ensure() maybe @jayarjo |
Since TinyMCE 4.5.2 you should not have to use the imports/exports loader anymore, so maybe this works now if you remove those loaders? So just remove this: {
test: require.resolve('tinymce/tinymce'),
loaders: ['imports?this=>window', 'exports?window.tinymce']
} From you webpack config. |
how to use inline theme in angula2 ? |
There is an official Angular wrapper project now (tinymce-angular). Closing this ticket, any Angular related issues should be open in that project. |
(See: #2836)
I'm trying to make an Angular2 component for a TinyMCE editor in my project. Here's my current setup.
package.json
webpack.config.js
html-editor.component.ts
The Problem
When I try to load up my angular app and navigate to a page containing the HtmlEditorComponent, I get the following error.
Interestingly
If I add the following line to the top of
HtmlEditorComponent
:... and the following line to
webpack.config.js
'smodule.loaders
section:... the page successfully loads and the editor works!
BUT
If I then navigate to a different page of the Angular app, I get the following error:
That above stack trace is originating from these lines in
app.bundle.js
The problem seems to be that the block above is trying to access
tinymce
but TinyMCE is only available viawindow['tinymce']
Any ideas? I'm in over my head here.
The text was updated successfully, but these errors were encountered: