【问题标题】:Ngx-Quill ERROR in Directive QuillEditorBase指令 QuillEditorBase 中的 Ngx-Quill 错误
【发布时间】:2020-05-16 13:35:47
【问题描述】:

我按照基本步骤设置 ngx-quill。经过一些研究,我还安装了 ngx-quill 和 quill。但我仍然遇到同样的错误。

ERROR in Directive QuillEditorBase in .../node_modules/ngx-quill/ngx-quill.d.ts has no selector, please add it!
Cannot determine the module for class QuillEditorBase .../node_modules/ngx-quill/ngx-quill.d.ts! Add QuillEditorBase to the NgModule to fix it.

我只是用<quill-editor></quill-editor>使用eidtor

我使用它的组件是延迟加载的。我将QuillModule.forRoot() 添加到我的主模块的导入中,并尝试将其添加到我的延迟加载模块中。然后我尝试将它添加到两者中,并且我还尝试在没有forRoot() 的情况下添加它。错误保持不变。我不知道应该在哪里将 QuillEditorBase 添加到 ngmodule。

我做错了什么?我没有自定义配置。我刚刚安装它并想尝试让它工作..

【问题讨论】:

  • 发布您声明组件尝试使用它的模块的代码以及您尝试使用它的组件的模板代码,以及 package.json 依赖项...通常对于这样的问题,您希望简化问题并删除变量。首先尝试在您的应用程序模块和应用程序组件中执行此操作,然后从那里移动。我的直觉告诉我这里版本不匹配。

标签: angular quill ngx-quill


【解决方案1】:

我也有同样的问题

Date: 2020-07-27T07:45:39.650Z - Hash: 674c36d8cc4fe0a89c1d - Time: 39499ms
ERROR in : Directive QuillEditorBase in /Users/louie/Development/mobile/node_modules/ngx-quill/ngx-quill.d.ts has no selector, please add it!
: Cannot determine the module for class QuillEditorBase in /Users/louie/Development/mobile/node_modules/ngx-quill/ngx-quill.d.ts! Add QuillEditorBase to the NgModule to fix it.
[ERROR] An error occurred while running subprocess ng.

由于我使用 Ionic Cordova 4 和 Angular ~8.1.2 和“quill”:"^1.3.7",“ngx-quill”:"^12.0.0"

我查看了 quill 的文档,发现了这个。

Compatibility to Angular Versions
Angular ngx-quill   supported
v10 >= 12.0.0   until Feb 24, 2022
v9  >= 8.0.0    until Aug 06, 2021
v8  >= 5.2.0, < 9   until Nov 28, 2020

所以,为了解决我遇到的问题。我将 ngx-quill 从 v12.0.0 降级为 5.2.0。之后就编译成功了。

【讨论】:

  • 谢谢路易。我有同样的问题,这个解决方案有效。现在升级到 Angular 10 :)
  • 我确实必须删除我正在使用的一个导入并更新事件处理程序:import { EditorChangeContent } from 'ngx-quill'changedEditor(event: EditorChangeContent) { 变为 changedEditor(event: any) {
【解决方案2】:

感谢@bryan60 的提示。这确实是版本不匹配。我安装了最新版本的 quill,但在 angular 8 上运行,这需要 quill 版本

【讨论】:

    猜你喜欢
    • 2018-05-19
    • 2019-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-27
    • 1970-01-01
    • 2022-10-06
    相关资源
    最近更新 更多