CKEditor issue in gulp-concat

烂漫一生 提交于 2019-12-24 21:38:04

问题


In my angularjs application, I'm using angular-ckeditor directive for CKEditor to get user inputs(Description and comments).

This is my html code to take description;

<div ckeditor="options" ng-model="txtDesc" ng-change="descChange()"></div>

and for comments;

<div ckeditor="options" ng-model="txtComment"></div>

And according to this github article;

Note : obviously this plugin expects the presence of AngularJS and CKEditor.

This is how I'm referring my JS files;

<!-- CK editor -->
<script src="{% static "scripts/angular.js" %}"></script>
<script src="{% static "scripts/ckeditor/ckeditor.js" %}"></script>
<script src="{% static "scripts/angular-ckeditor.js" %}"></script>

It is working fine in normal flow. But when I try to concat all scripts file in one file using gulp-concat, It throws following errors for both editors;

The editor instance "editor1" is already attached to the provided element.

The editor instance "editor2" is already attached to the provided element.

This is my JS reference after gulp-concat;

<script src="{% static "scripts/scripts.js" %}"></script>
<script src="{% static "scripts/ckeditor/ckeditor.js" %}"></script>
<script src="{% static "scripts/angular-ckeditor.js" %}"></script>

script.js has angular.js file data with all other js files (Concat all js files in one file). But ckeditor does not get the reference correctly. I tried to concat angular-ckeditor.js also wihtin scripts.js file, but it results in same. What can I do to get over this error?

来源:https://stackoverflow.com/questions/49046217/ckeditor-issue-in-gulp-concat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!