gulp-concat中的CKEditor问题

时间:2018-03-01 09:10:02

标签: angularjs gulp ckeditor gulp-concat

在我的angularjs应用程序中,我使用angular-ckeditor 指令为CKEditor获取用户输入(描述和注释)。

这是我的html代码,用于描述;

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

和评论;

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

根据this github article;

  

注意:显然这个插件需要AngularJS和CKEditor的存在。

这就是我引用我的JS文件的方式;

<!-- 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>

正常流量正常。但是当我尝试使用gulp-concat将所有脚本文件连接到一个文件中时,它会为两个编辑器抛出以下错误;

  

编辑器实例&#34; editor1&#34;已附加到提供的元素。

     

编辑器实例&#34; editor2&#34;已附加到提供的元素。

这是我在gulp-concat后的JS引用;

<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具有angular.js文件数据和所有其他js文件(Concat所有js文件在一个文件中)。但是ckeditor没有正确获得引用。我试图将angular-ckeditor.jsscripts.js文件联系起来,但结果相同。我该怎么做才能克服这个错误?

0 个答案:

没有答案
相关问题