有什么方法可以在 Angular 所见即所得指令中使用 colorPicker 而无需使用 jQuery
Is there any way to use colorPicker in Angular WYSIWYG directive without using jQuery
当我删除 jquery refrence 颜色选择器在所见即所得指令中不起作用并且在我的项目中我不应该使用 jQuery
所以有没有什么方法可以不使用 jquery?或者有没有其他没有 jquery 引用的编辑器?plunker with jquery ref
您实际上遇到的问题不是 colorPicker
,而是 wysiwyg
模块本身,如其代码注释中所述:
Requires: Twitter-bootstrap, fontawesome, jquery, angularjs, bootstrap-color-picker
无论如何,幸运的是,该模块只对 bootstrap 和工具提示插件使用 jquery...
所以我有:
- 用 UI Bootstrap 替换了原来的 bootstrap for angularjs
- 添加了 ngSanitize 模块,提供清理功能 HTML。
- 破解
wysiwyg
模块以使用 uib-tooltip
指令
- 为
contenteditable
div 创建了一个新的临时指令
- 来源 plunker
希望这对您有所帮助。 ;-)
当我删除 jquery refrence 颜色选择器在所见即所得指令中不起作用并且在我的项目中我不应该使用 jQuery
所以有没有什么方法可以不使用 jquery?或者有没有其他没有 jquery 引用的编辑器?plunker with jquery ref
您实际上遇到的问题不是 colorPicker
,而是 wysiwyg
模块本身,如其代码注释中所述:
Requires: Twitter-bootstrap, fontawesome, jquery, angularjs, bootstrap-color-picker
无论如何,幸运的是,该模块只对 bootstrap 和工具提示插件使用 jquery...
所以我有:
- 用 UI Bootstrap 替换了原来的 bootstrap for angularjs
- 添加了 ngSanitize 模块,提供清理功能 HTML。
- 破解
wysiwyg
模块以使用uib-tooltip
指令 - 为
contenteditable
div 创建了一个新的临时指令
- 来源 plunker
希望这对您有所帮助。 ;-)