首页 > 解决方案 > 未捕获的错误:[jqLit​​e:nosel] http://errors.angularjs.org/1.5.11/jqLit​​e/nosel & 警告:尝试多次加载 Angular

问题描述

我想为我的项目添加 ng-quill 富文本编辑器。为此,我使用 bower 安装了 quill 和 ng-quill。(参考:ngQuill Documentation && quill不是构造函数问题

bower.json:

"quill": 
"https://github.com/quilljs/quill/releases/download/v1.1.5/quill.tar.gz",
"ngQuill": "ngquill#^3.8.0"

然后在 index.html 中添加 angular、quill 和 ngQuill 的脚本:

<script type="text/javascript" src="bower_components/angular/angular.min.js"> 
</script>
<script type="text/javascript" src="bower_components/quill/quill.js"> 
</script>
<script type="text/javascript" src="bower_components/ngQuill/src/ng- 
quill.js"></script>

然后,我在 app 模块中添加了 ngQuill 依赖项。(function () { '使用严格';

/**
 * Main module
 */
angular
    .module('fuse', [

        // Core
        'app.core',

        'satellizer',
        'ngStorage',
        'ngFileSaver',
        'ui.tree',
        'as.sortable',
        'flow',
        'cfp.hotkeys',
        'infinite-scroll',
        'nvd3',
        'ngIdle',
        angularDragula(angular),
        'ngQuill'
    ]);

})();

然后,我在 html 中添加了指令:

 <ng-quill-editor ng-model="vm.message" toolbar="true" link-tooltip="true" 
 image-tooltip="true" toolbar-entries="font size bold list bullet italic 
 underline strike align color background link image" editor-required="true" 
 required="" error-class="input-error"></ng-quill-editor>

最后,在本地运行后,控制台报错:

控制台中的错误

如何解决这个问题?我正在使用的版本是(我也在使用 fuse 主题):
angular: 1.5.11
bower: 1.8.4
gulp: 3.9.0
quill: 1.1.5
ng-quill: 3.8.0

标签: angularjsgulpbowerfusequill

解决方案


推荐阅读