angularjs - 未捕获的错误:[jqLite:nosel] http://errors.angularjs.org/1.5.11/jqLite/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
解决方案
推荐阅读
- javascript - 以自定义方式对匹配器结果进行排序
- python - 熊猫应用从数据框中的字符串中删除尾随零
- reactjs - Laravel 8 不使用默认路由
- amazon-web-services - AWS CDK CORS 错误与 Cloudfront + S3 上的静态网站 + API 网关 + Lambda + DynamoDb 设置
- php - php artisan 命令在本地而不是在 Docker 容器内运行时显示 Redis 错误
- javascript - 检查迭代索引是否可被 2 整除
- angular - 带有角度的unix套接字的客户端
- python - URL 被 webbrowser.get 截断
- sql - SQL Server 更新行,其中日期不是记录按某个 ID 分组时的最大日期
- java - 在中央找不到工件 sun-jaxb:jaxb-api:jar:2.2