0
我在角项目中使用了ui-tinymce模块。在一个控制器被称为tinymce.execCommand('mceRemoveControl', true, 'ntContent');
,这工作正常。但在grunt构建命令后,我得到以下错误:ReferenceError: tinymce is not defined
。有人能帮忙吗 ?Angular JS ui-tinymce
我在角项目中使用了ui-tinymce模块。在一个控制器被称为tinymce.execCommand('mceRemoveControl', true, 'ntContent');
,这工作正常。但在grunt构建命令后,我得到以下错误:ReferenceError: tinymce is not defined
。有人能帮忙吗 ?Angular JS ui-tinymce
我与angular-ui-tinymce模块有同样的问题,我通过确保包含该文件来解决此问题。
<script src="bower_components/tinymce-dist/tinymce.min.js"></script>
<script src="bower_components/angular-ui-tinymce/src/tinymce.js"></script>
此脚本插入index.html文件bower install angular-ui-tinymce
和也源代码被下载并放置在适当的位置。
此外,当你在副本任务运行grunt build
它不会复制从/tinymce-dist
文件夹所需的文件和一个解决方法是手动添加到副本任务复制你需要的文件夹。我通过插入下面的代码到/skins
/themes
/plugins
文件夹直接复制到该文件夹dist/scripts
进入grunt.js文件的副本任务:
// Copies remaining files to places other tasks can use
copy: {
dist: {
files: [{
...
}, {
...
}, {
expand: true,
cwd: 'bower_components/tinymce-dist/themes/modern/',
src: ['**'],
dest: '<%= yeoman.dist %>/scripts/themes/modern/'
}, {
expand: true,
cwd: 'bower_components/tinymce-dist/skins/',
src: ['**'],
dest: '<%= yeoman.dist %>/scripts/skins/'
}, {
expand: true,
cwd: 'bower_components/tinymce-dist/plugins/link/',
src: ['**'],
dest: '<%= yeoman.dist %>/scripts/plugins/link/'
}]
},
styles: {
...
}
}
这是不是有史以来最好的解决方案,但它的工作对我来说,希望它有助于某人。
听起来像tinymce JavaScript依赖不包括在内。它无法处理任何地方声明的'tinymce'变量。在运行所有角码之前,请检查以确保tinymce JavaScript文件正在加载。 – reblace 2015-02-17 16:22:01
尝试直接在您的页面头中使用cdn – Saifee 2016-12-25 08:01:24